ITeye博客

nginx 代理https后,应用redirect https变成http

hzp · 2015-08-12 11:07 · nginx · 互联网 · Markdown

配置 Nginx 的转发选项:
proxy_set_header X-Forwarded-Proto $scheme;

配置Tomcat server.xml 的 Engine 模块下配置一个 Value:
<Valve className="org.apache.catalina.valves.RemoteIpValve" remoteIpHeader="X-Forwarded-For" protocolHeader="X-Forwarded-Proto" protocolHeaderHttpsValue="https"/>

配置双方的 X-Forwarded-Proto 就是为了正确地识别实际用户发出的协议是 http 还是 https。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。