A question about java web apps and X-REAL-IP header

前端 未结 2 540
梦谈多话
梦谈多话 2021-01-25 14:35

I\'m setting up a demo of a project for a client. On my server I have a lot of sites built with different technologies that are running under different servers on different port

2条回答
  •  别那么骄傲
    2021-01-25 15:12

    You can do this using Tomcat's RemoteIpValve

    
    

    That way, when you call request.getRemoteAddr(), it will be providing the right information. By the way, you probably want to use the more standard header, which is X-Forwarded-For.

提交回复
热议问题