解决vue项目部署后刷新404问题
https://www.jianshu.com/p/ea514aec2a6a
location / {
root html;
index index.html index.htm;
try_files $uri $uri/ /index.html; # 主要是这句配置
}
location /huiyu-platform/ {
proxy_pass http://1xxxxxx:xxxx/huiyu-platform/;
proxy_redirect off;
#真实IP获取
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
set $my_proxy_add_x_forwarded_for $proxy_add_x_forwarded_for;
if ($proxy_add_x_forwarded_for ~* "127.0.0.1"){
set $my_proxy_add_x_forwarded_for $remote_addr;
}
proxy_set_header X-Forwarded-For $my_proxy_add_x_forwarded_for;
}