server {

        listen       80;

        server_name  localhost;

        location /{

            root   html;

            index  index.html index.htm;

                            proxy_pass                  http://backend; 

           proxy_redirect              off;

           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-For $http_x_forwarded_for;

        }

代码中使用:

request.getAttribute("X-Forwarded-For")

Ref:http://blog.csdn.net/a936676463/article/details/8961504

相关文章:

  • 2021-12-08
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2021-05-25
  • 2022-12-23
  • 2021-08-07
猜你喜欢
  • 2021-12-14
  • 2021-12-13
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
相关资源
相似解决方案