Forwarding Client Real IPs from Nginx Reverse Proxy to Apache
A common high-performance web architecture deploys Nginx on the public frontend (port 80/443) to handle TLS termination, static asset caching, and request routing, reverse-proxying dynamic requests to an Apache backend (e.g., listening on port 8080 or localhost). However, without explicit header forwarding, Apache logs will show all incoming requests originating from 127.0.0.1 (the reverse proxy IP) rather than the client’s actual public IP. This disrupts geolocation, fraud detection, rate-limiting, and security audit trails. ...