nginx转发tomcat之https不生效

1、修改tomcat配置server.xml,让它从请求头中的X-Forwarded-Proto读取

<!-- xpath://Server/Service/Engine/Value -->

<
Valve className="org.apache.catalina.valves.RemoteIpValve" remoteIpHeader="X-Forwarded-For" protocolHeader="X-Forwarded-Proto" protocolHeaderHttpsValue="https"/>

 

2、nginx.conf增加配置

 

location / {
    ...  
    proxy_set_header X-Forwarded-Proto  $scheme;
    ...
}

 

 

来源:https://blog.csdn.net/tjcyjd/article/details/70185224

posted @ 2022-12-14 22:59  chendeming  阅读(437)  评论(0编辑  收藏  举报