Nginx CloudFlare restore real ip

When using Nginx Behind Cloudflare, logs and web applications show cloudflare sever IP instead of visitor IP.

To fix this, edit

Inside “http” section, add

You can get updated list of CloudFlare IPs from

Restart Nginx with

Example Nginx Config

Leave a Reply

Your email address will not be published. Required fields are marked *