nginx反代后无法加载Discuz登录验证码

付费节点推荐


免费节点


节点使用教程


在配置Nginx反向代理Discuz时遇到登录验证码加载失败的问题,原因是Discuz通过User-Agent和Host头来判断请求来源。为了解决这个问题,需要在Nginx的配置中添加`proxy_pass_headerUser-Agent;`和`proxy_set_headerHost$host;`这两行指令,确保这些头部信息被正确传递。
————————————————

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/cc62480507/article/details/131131037

**问题:**在使用nginx后,登陆时发现无法加载图形验证码,发现discuz会在头部判断用户来源。
**解决方法:**在nginx配置中加入

proxy_pass_header User-Agent;
proxy_set_header Host $host;

例如:

location / {
proxy_pass https://server;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
proxy_pass_header User-Agent;
proxy_set_header Host $host;
}

未经允许不得转载:Bcoder资源网 » nginx反代后无法加载Discuz登录验证码

相关推荐

赞 (13)
分享到:更多 ()