|
Nginx logging client's ip
We need to add --with-http_realip_module when installed on the proxy settings :()
proxy_set_header Host $ host;
proxy_set_header X-Forwarded-For $ remote_addr;
set_real_ip_from ip; (fill in the ip is the proxy ip)
real_ip_header X-Forwarded-For;
When web rear end :( installation need to add --with-http_realip_module)
set_real_ip_from ip; (fill in the ip is the proxy ip)
real_ip_header X-Forwarded-For;
Add $ remote_addr or $ http_x_forwarded_for parameters log_format inside. |
|
|
|