nginx 部署angular项目

ng1:

location / {
  root   D:\WebstormProjects\angular-demo\src;
  index  index.html index.htm;
}

ng2:

location / {
  root   D:\WebstormProjects\angular-store\dist;
  index  index.html index.htm;
  try_files $uri $uri/ /index.html;
}

解决js加载问题,修改index.html中的base href为./

你可能感兴趣的:(杂,angular,nginx)