Skip to content

Instantly share code, notes, and snippets.

@jonasbjork
Last active December 26, 2017 02:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jonasbjork/2e9c32158bfb7546ee0a to your computer and use it in GitHub Desktop.
Save jonasbjork/2e9c32158bfb7546ee0a to your computer and use it in GitHub Desktop.
Nginx - Get real client IP behind Amazon Cloudfront
real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 10.0.0.0/16;
set_real_ip_from 54.192.0.0/16;
set_real_ip_from 54.230.0.0/16;
set_real_ip_from 54.239.128.0/18;
set_real_ip_from 54.239.192.0/19;
set_real_ip_from 54.240.128.0/18;
set_real_ip_from 204.246.164.0/22;
set_real_ip_from 204.246.168.0/22;
set_real_ip_from 204.246.174.0/23;
set_real_ip_from 204.246.176.0/20;
set_real_ip_from 205.251.192.0/19;
set_real_ip_from 205.251.249.0/24;
set_real_ip_from 205.251.250.0/23;
set_real_ip_from 205.251.252.0/23;
set_real_ip_from 205.251.254.0/24;
set_real_ip_from 216.137.32.0/19;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment