nginx代理后端服务返回404
nginx代理后端服务返回404
需带上host头
location ^~ /publicApi/ {
rewrite ^/publicApi/(.*)$ /public/v1/$1 break;
proxy_pass http://public-api-backend:8231/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
如对您有帮助,支持下呗!
微信
![](https://files.cnblogs.com/files/Dev0ps/WeChat.gif)
支付宝
![](https://files.cnblogs.com/files/Dev0ps/Alipay.gif)