代码改变世界

nginx 真实ip

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;

        }

posted on 2017-07-28 10:36  Captain林  阅读(147)  评论(0编辑  收藏  举报

导航