导航

nginx 代理tomcat 代码获取不到scheme是https

Posted on 2021-07-23 11:50  蒋翔  阅读(402)  评论(0编辑  收藏  举报

nginx 请求头设置

proxy_set_header       Host $host;

proxy_set_header  X-Real-IP  $remote_addr;

proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto  $scheme;

tomcat  conf/server.xml

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