我的 Angular 应用程序正在 nginx 服务器上运行。当我输入http://**.8.100.248:30749
它时,显示 nginx 正在运行。(显示默认 index.html)。但是我的应用程序存在于html
具有文件夹名称的文件夹中test
。所以我的应用程序出现在“html”中——> 测试——> index.html”;;
因此,当我在浏览器上键入http://**.8.100.248:30749/test/index.html
我的应用程序时,但是当我从一个页面路由到另一个页面时,reload
我的页面给了我404
.
当我重新加载我的角度路由页面时,Nginx 给了我 404。所以我改变了nginx配置但仍然没有成功
location / {
root /usr/share/nginx/html;
index index.html index.htm;
expires -1;
add_header Pragma "no-cache";
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
try_files $uri$args $uri$args/ $uri $uri/ /test/index.html =404;
}
任何更新