[英]haproxy + nginx get client ip behind anonymous proxy
I'm creating an application, where frontend is Haproxy and nginx. 我正在创建一个前端为Haproxy和nginx的应用程序。 Do you know a way to get client IP address if navigates behind anonymous proxy with HAproxy ?
如果使用HAproxy在匿名代理后面导航,您是否知道获取客户端IP地址的方法?
My actual configuration for haproxy use "option forwardfor", but I get anonymous proxy IP instead real client IP in nginx logs (using $http_x_forwarded_for var) 我对haproxy的实际配置使用“ option forwardfor”,但是我在nginx日志中获得了匿名代理IP而不是真实的客户端IP(使用$ http_x_forwarded_for var)
frontend general_frontend
bind 111.111.111.111:80
default_backend nginx_farm_backend
backend nginx_farm_backend
balance roundrobin
option abortonclose
option forwardfor
http-check disable-on-404
http-check expect string nginx
option httpchk GET /index.html HTTP/1.0
# - Nodes
server nginx-server-1 222.222.222.222:8080 check on-error mark-down observe layer7 error-limit 1
server nginx-server-1 333.333.333.333:8080 check on-error mark-down observe layer7 error-limit 1
Thank you 谢谢
您是否将$ remote_addr var用于nginx日志格式?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.