在 Cloudflare、Nginx、Application Server 三層架構下,AP 收到的 IP 可能是 Cloudflare 節點的、Nginx 的 127.0.0.1、或使用者的真實 IP,搞混會讓 Rate Limit 和 access log 全部失準。本文圖解請求經過每一層時 X-Forwarded-For、X-Real-IP、CF-Connecting-IP 的變化,說明 Nginx real_ip 還原設定,並提供 Node.js、Python、Java、C# 取得真實 IP 的範例。