Skip to content

Instantly share code, notes, and snippets.

@ptierno
Forked from jonasbjork/cloudfront.txt
Created July 18, 2017 15:48
Show Gist options
  • Save ptierno/5a5f2e568d8734b9d1b8fe46152ebe8d to your computer and use it in GitHub Desktop.
Save ptierno/5a5f2e568d8734b9d1b8fe46152ebe8d 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