浏览器路由 浏览器刷新,页面404,依靠nginx配置解决
2022-07-14 本文已影响0人
日不落000
- 浏览器刷新,页面404, 相关Nginx配置如下:
location ^~/powervischart/static/ {
alias /usr/local/webserver/nginx/html/static/;
}
location ~* \.(gif|jpg|png|js|css|ttf|woff|woff2)$ {
# root /usr/local/webserver/nginx/html/;
}
location /powervischart/ {
root /usr/local/webserver/nginx/html/;
# autoindex on;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location / {
root /usr/local/webserver/nginx/html/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}