vuejs在nginx非根目录下部署,页面强制刷新时出现404解决方法。
server {
listen 80;
server_name xxxx.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location /vuejs-admin-server {
proxy_pass http://127.0.0.1:8080/vuejs-admin-server;
}
#二级目录配置开始
location ^~/tools {
alias /www/wwwroot/xxx.cn/tools/;
#index index.html;
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^/(tools)/(.+)$ /$1/index.html last;
}
#二级目录配置结束
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
上面是“解决vuejs应用在nginx非根目录下部署时强制刷新404”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2142.html
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

Open Coding Agents:低成本、可复现的开源编程智能体,支持任意私有代码库
帝国CMS没有相关信息时调用其它信息教程
Vuejs中关于methods、computed、watch,mounted有什么不同
帝国cms7.5正式版提示报错:留言板 gb is close 问题 










