反向代理后端 response.sendRedirect() 地址不对
原配置
location / {
proxy_pass http://localhost:8086;
}
修改为
location / {
proxy_pass http://localhost:8086;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
原文链接:https://blog.youkuaiyun.com/zhh123sy001/article/details/86491335
本文介绍了一种解决反向代理环境下response.sendRedirect()地址不正确的问题的方法。通过调整Nginx配置文件中的location块参数,确保了重定向能够正常工作。
2303

被折叠的 条评论
为什么被折叠?



