多层nginx代理获取真实IP

多层nginx代理获取真实IP

  • 单层代理获取真实IP

  • 多层代理获取真实IP

  • HTTP 请求头中的 X-Forwarded-For,X-Real-IP

		location / {
            try_files $uri $uri/ /index.html;
            proxy_set_header    Host    $host;
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /installment/ {
            proxy_pass http://120.78.195.171:8085;
            proxy_set_header    Host    $host;
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        }

你可能感兴趣的:(java)