location / {
root /html/dist;
index index.html index.htm;
try_files $uri $uri/ @router; # 解决nginx中vue项目刷新报404问题
}
location @router {
rewrite ^.*$ /index.html last;
}
location ^~/prod-api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:xxxx/;
}