Posts in 2022
NGINX access_log log the real client IP from X-Forwarded-For/X-Real-IP/cf-connecting-ip instead of the proxy IP
Last Update: in nginx
Have a nginx server receive requests from proxy or behind CDN, how to get client user’s real IP instead of proxy/CDN servers IP in access log? This article provide two solutions based on
log_format
and nginxrealip
module.Problem If you have an Nginx server receiving requests from a proxy or behind a CDN, how can you get the client’s real IP instead of the proxy/CDN server’s IP in the access log? When using Cloudflare Argo Tunnel, the Nginx log shows the …