Skip to content

Instantly share code, notes, and snippets.

@anmsid
Created March 13, 2014 14:26
Show Gist options
  • Save anmsid/9529501 to your computer and use it in GitHub Desktop.
Save anmsid/9529501 to your computer and use it in GitHub Desktop.
Nginx configuration to detect real ip of requests originating from cloudflare servers
# CloudFlare IP Ranges
# Generated at Sat Oct 5 13:51:31 UTC 2013 by ./cloudflare_ips.sh
set_real_ip_from 204.93.240.0/24;
set_real_ip_from 204.93.177.0/24;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 127.0.0.1;
real_ip_header CF-Connecting-IP;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment