Apache, Nginx获得nginx代理后的真实用户Ip
2014-03-11 18:11
344 查看
Nginx 的反向代理设置 proxy_set_header X-Real-IP $remote_addr;
apache可以设置日志格式将 %h替换为 %{X-Real-Ip}i
如: LogFormat "%{X-Real-Ip}i %l %u %t \"%m http://%v%U%q\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" - %h" combined
nginx可以设置$http_x_real_ip变量。
如 log_format main '$http_x_real_ip - $remote_user '
'[$time_local] "$request_method $scheme://$host$request_uri $server_protocol" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" - $remote_addr';
Nginx写的不错的博客 /article/4340860.html 排版更是顶呱呱 我的学长。
apache可以设置日志格式将 %h替换为 %{X-Real-Ip}i
如: LogFormat "%{X-Real-Ip}i %l %u %t \"%m http://%v%U%q\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" - %h" combined
nginx可以设置$http_x_real_ip变量。
如 log_format main '$http_x_real_ip - $remote_user '
'[$time_local] "$request_method $scheme://$host$request_uri $server_protocol" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" - $remote_addr';
Nginx写的不错的博客 /article/4340860.html 排版更是顶呱呱 我的学长。
相关文章推荐
- Nginx反向代理Apache的情况下让Apache获得真实IP
- Nginx和Apache共存环境下apache获得真实IP
- 多级代理下Nginx获取真实用户IP地址的总结
- nginx代理获取用户真实ip
- 多级代理下Nginx获取真实用户IP地址的总结
- nginx反向代理httpd获取用户真实ip
- 使用nginx反向代理时,如何正确获取到用户的真实ip
- Nginx前端设置反向代理,后端Apache如何获取访客的真实IP,结合PHP
- Nginx做前端时,后端Apache获得真实IP的做法
- nginx代理web,后端无法获取用户真实IP
- 多级代理下Nginx获取真实用户IP地址的总结
- 用nginx做前端,后端apache能获得真实IP的方法
- Haproxy做代理,后端nginx获取真实用户IP
- 根据IP(有代理的情况)定位城市以及通过nginx转发的tomcat如何得到用户真实的ip
- Nginx代理显实真实IP的解决
- nginx反向代理后应用程序如何获取客户端真实IP?
- nginx反向代理后应用程序如何获取客户端真实IP?
- nginx前端负载,后端apache获取真实IP设置
- LAMP--Apache 日志记录代理 ip 和真实客户端 ip
- 多层nginx代理tomcat获取客户端真实ip