vue部署在nginx后刷新404,nginx.conf一行代码解决掉

直接 vim conf/nginx.conf文件

server {
listen 8081;
server_name localhost;

charset koi8-r;

access_log logs/host.access.log main;

location / {
root /home/www;
index index.html index.htm;
try_files $uri $uri/ /index.html;

}

然后esc 退出 wq! 进行保存

关闭 …./nginx -s stop

重启 …/nginx

Original: https://www.cnblogs.com/angelasp/p/13026377.html
Author: Angelasp
Title: vue部署在nginx后刷新404,nginx.conf一行代码解决掉

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/643882/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球