haproxy后端nginx取得用户访问ip地址
set_real_ip_from 172.16.100.120;#haproxy 的IP地址set_real_ip_from 172.16.100.110;#haproxy 的IP地址
real_ip_header X-Forwarded-For;
log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; haproxy 里http下 option forwardfor
nginx配置文件设置如上
后端nginx服务可以取得用户访问的真实ip地址。
页:
[1]