Skip to content

Commit 7f03d34

Browse files
committed
Auto merge of #1906 - jtgeibel:cloudfront-real-ip, r=sgrif
Add CloudFront IP ranges as trusted for real_ip This change will allow nginx to recurse past the CloudFront IP addresses and store the correct client IP address in `$remote_addr`. It is important that the correct client IP is available for rate limiting on the publish endpoint and logging. This list will need to be updated periodically. cc @pietroalbini - This should probably be deployed before we enable CloudFront on production.
2 parents 2efe33d + a35c6ea commit 7f03d34

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

config/nginx.conf.erb

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,76 @@ http {
1414
real_ip_header X-Forwarded-For;
1515
real_ip_recursive on;
1616

17+
# CloudFront IP addresses from http://d7uri8nf7uskq.cloudfront.net/tools/list-cloudfront-ips
18+
# Last updated: 2019-11-18
19+
set_real_ip_from 144.220.0.0/16;
20+
set_real_ip_from 52.124.128.0/17;
21+
set_real_ip_from 54.230.0.0/16;
22+
set_real_ip_from 54.239.128.0/18;
23+
set_real_ip_from 52.82.128.0/19;
24+
set_real_ip_from 99.84.0.0/16;
25+
set_real_ip_from 204.246.172.0/24;
26+
set_real_ip_from 205.251.192.0/19;
27+
set_real_ip_from 54.239.192.0/19;
28+
set_real_ip_from 70.132.0.0/18;
29+
set_real_ip_from 13.32.0.0/15;
30+
set_real_ip_from 13.224.0.0/14;
31+
set_real_ip_from 13.35.0.0/16;
32+
set_real_ip_from 204.246.164.0/22;
33+
set_real_ip_from 204.246.168.0/22;
34+
set_real_ip_from 71.152.0.0/17;
35+
set_real_ip_from 216.137.32.0/19;
36+
set_real_ip_from 205.251.249.0/24;
37+
set_real_ip_from 99.86.0.0/16;
38+
set_real_ip_from 52.46.0.0/18;
39+
set_real_ip_from 52.84.0.0/15;
40+
set_real_ip_from 204.246.173.0/24;
41+
set_real_ip_from 130.176.0.0/16;
42+
set_real_ip_from 64.252.64.0/18;
43+
set_real_ip_from 204.246.174.0/23;
44+
set_real_ip_from 64.252.128.0/18;
45+
set_real_ip_from 205.251.254.0/24;
46+
set_real_ip_from 143.204.0.0/16;
47+
set_real_ip_from 205.251.252.0/23;
48+
set_real_ip_from 204.246.176.0/20;
49+
set_real_ip_from 13.249.0.0/16;
50+
set_real_ip_from 54.240.128.0/18;
51+
set_real_ip_from 205.251.250.0/23;
52+
set_real_ip_from 52.222.128.0/17;
53+
set_real_ip_from 54.182.0.0/16;
54+
set_real_ip_from 54.192.0.0/16;
55+
set_real_ip_from 13.124.199.0/24;
56+
set_real_ip_from 34.226.14.0/24;
57+
set_real_ip_from 52.15.127.128/26;
58+
set_real_ip_from 35.158.136.0/24;
59+
set_real_ip_from 52.57.254.0/24;
60+
set_real_ip_from 18.216.170.128/25;
61+
set_real_ip_from 13.52.204.0/23;
62+
set_real_ip_from 13.54.63.128/26;
63+
set_real_ip_from 13.59.250.0/26;
64+
set_real_ip_from 13.210.67.128/26;
65+
set_real_ip_from 35.167.191.128/26;
66+
set_real_ip_from 52.47.139.0/24;
67+
set_real_ip_from 52.199.127.192/26;
68+
set_real_ip_from 52.212.248.0/26;
69+
set_real_ip_from 52.66.194.128/26;
70+
set_real_ip_from 13.113.203.0/24;
71+
set_real_ip_from 99.79.168.0/23;
72+
set_real_ip_from 34.195.252.0/24;
73+
set_real_ip_from 35.162.63.192/26;
74+
set_real_ip_from 34.223.12.224/27;
75+
set_real_ip_from 52.56.127.0/25;
76+
set_real_ip_from 34.223.80.192/26;
77+
set_real_ip_from 13.228.69.0/24;
78+
set_real_ip_from 34.216.51.0/25;
79+
set_real_ip_from 3.231.2.0/25;
80+
set_real_ip_from 54.233.255.128/26;
81+
set_real_ip_from 18.200.212.0/23;
82+
set_real_ip_from 52.52.191.128/26;
83+
set_real_ip_from 52.78.247.128/26;
84+
set_real_ip_from 52.220.191.0/26;
85+
set_real_ip_from 34.232.163.208/29;
86+
1787
gzip on;
1888
gzip_comp_level 2;
1989
gzip_proxied any;

0 commit comments

Comments
 (0)