版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/buyaore_wo/article/details/69787681
1.nginx的location中设置 header,如
location /ConfigService/{
proxy_read_timeout 90;
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;
proxy_pass http://www.qawe.info:8088/ConfigService/;
}
2.tomcat配置(server.xml)中添加RemoteIpValve配置,如
<Valve
className="org.apache.catalina.valves.RemoteIpValve"
httpServerPort="8088"
httpsServerPort="8443"
remoteIpHeader="x-forwarded-for"
proxiesHeader="x-forwarded-by"
protocolHeader="x-forwarded-proto"
/>

相关文章:

  • 2021-04-03
  • 2021-04-19
  • 2021-08-09
  • 2021-06-21
  • 2021-07-15
  • 2021-11-29
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-12-24
  • 2022-12-23
  • 2021-09-12
  • 2022-02-13
相关资源
相似解决方案