server {server_name yoursite.com;root /usr/share/html;index index.html;location / {try_files $uri $uri/ /index.html;}}Basically, Nginx first tries a URI without the ending / and if it's not found then Nginx tries with the trailing /
If still not found then forward the request to the /index.html page. Angular is then able to read the URL location to determine how to route the request.
https://gist.github.com/cjus/b46a243ba610661a7efb
nginx对于AngularJS路由的rewrite
最新推荐文章于 2021-04-08 22:13:45 发布