By accessing the website and accepting the Cookie Policy, you agree to use the cookies provided by the Site in accordance with to analyze traffic, remember your preferences, and optimize your experience.
Nginx反带强制使用https协议
2022-03-23 22:25:15    13    0    0
emengweb

如果您的nginx服务,并没有直接面向最终用户,而是在某些负载均衡/cdn后面,并且您的ssl证书是在这些负载均衡/cdn上面配置的,那么有可能会导致nginx无法正确获取客户端所使用的协议,从而导致无法将客户端使用的协议传递给为用户。在这种情况下,您可以修改nginx配置,强制使用https协议。

 

修改反带的配置,直接将proxy_set_header X-Forwarded-Proto $scheme修改成

proxy_set_header X-Forwarded-Proto "https";​​
 

 

上一篇: CSS 选择器参考手册

下一篇: DD备份整个VPS,并还原到其它VPS上

13 人读过
文档导航