How to Make Nginx Reveal Real Visitor IP Behind CDN in Just 2 Lines
After enabling a CDN or cloud firewall, your server only sees the CDN node’s IP, causing login risk, IP bans, fake logs, and difficulty tracing attacks; this guide shows how to add two Nginx directives to trust the X‑Forwarded‑For header and accurately capture the true client IP, with optional security recommendations.
