角度为4的Nginx路由问题

时间:2017-06-20 12:24:20

标签: angular nginx nginx-location

有人可以解决Nginx路由问题 我的conf文件有以下位置部分

  location /pages {
     alias /path/to/dist/folder
     index index.html;
   }

当我点击http://example.com/pages时,我按照角度4路由获取http:example.com/pages/home页面,但是当我直接点击http:example.com/pages/home -its throw bad请求502

1 个答案:

答案 0 :(得分:2)

Try the following redirection of routes to the index.html

index index.html;

location / {
  try_files $uri $uri/ /index.html;
}