配置web服务器,记录负载均衡透传的客?端IP地址
#apache 配置:
LogFormat "%{X-Forwarded-For}i %a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
#tomcat 配置:
pattern=‘%{X-Forwarded-For}i %l %T %t "%r" %s %b"%{User-Agent}i"‘/>
#nginx ?志格式:
log_format main ‘"$http_x_forwarded_For" - $remote_user
[$time_local] "$request" ‘
‘$status $body_bytes_sent
"$http_referer" ‘
‘"$http_user_agent" ‘;