码迷,mamicode.com
首页 > 其他好文 > 详细

ngnix反向代理后获取用户真实ip

时间:2019-10-13 18:39:17      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:ati   war   test   获取   forward   set   oca   _for   real   

server
{
listen 80;
listen 802;
server_name test111.xxxx.com 118.24.122.131;
#charset koi8-r;
location / {
proxy_pass http://127.0.0.1:82;
# $host 变量,Host 为变量名
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#access_log logs/host.access.log main;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
root html;
index index.html index.htm default.aspx;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}

ngnix反向代理后获取用户真实ip

标签:ati   war   test   获取   forward   set   oca   _for   real   

原文地址:https://www.cnblogs.com/dfsxh/p/11667193.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!