Skip to content

Commit 58a75cb

Browse files
committed
transparent nginx integration for CloudFlare
1 parent 08c1dea commit 58a75cb

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

install/debian/nginx.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ http {
6868
proxy_buffers 32 4k;
6969

7070

71+
# Cloudflare
72+
set_real_ip_from 199.27.128.0/21;
73+
set_real_ip_from 173.245.48.0/20;
74+
set_real_ip_from 103.21.244.0/22;
75+
set_real_ip_from 103.22.200.0/22;
76+
set_real_ip_from 103.31.4.0/22;
77+
set_real_ip_from 141.101.64.0/18;
78+
set_real_ip_from 108.162.192.0/18;
79+
set_real_ip_from 190.93.240.0/20;
80+
set_real_ip_from 188.114.96.0/20;
81+
set_real_ip_from 197.234.240.0/22;
82+
set_real_ip_from 198.41.128.0/17;
83+
set_real_ip_from 162.158.0.0/15;
84+
set_real_ip_from 104.16.0.0/12;
85+
set_real_ip_from 2400:cb00::/32;
86+
set_real_ip_from 2606:4700::/32;
87+
set_real_ip_from 2803:f800::/32;
88+
set_real_ip_from 2405:b500::/32;
89+
set_real_ip_from 2405:8100::/32;
90+
real_ip_header CF-Connecting-IP;
91+
92+
7193
# SSL PCI Compliance
7294
ssl_session_cache shared:SSL:10m;
7395
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

install/rhel/nginx.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ http {
6868
proxy_buffers 32 4k;
6969

7070

71+
# Cloudflare
72+
set_real_ip_from 199.27.128.0/21;
73+
set_real_ip_from 173.245.48.0/20;
74+
set_real_ip_from 103.21.244.0/22;
75+
set_real_ip_from 103.22.200.0/22;
76+
set_real_ip_from 103.31.4.0/22;
77+
set_real_ip_from 141.101.64.0/18;
78+
set_real_ip_from 108.162.192.0/18;
79+
set_real_ip_from 190.93.240.0/20;
80+
set_real_ip_from 188.114.96.0/20;
81+
set_real_ip_from 197.234.240.0/22;
82+
set_real_ip_from 198.41.128.0/17;
83+
set_real_ip_from 162.158.0.0/15;
84+
set_real_ip_from 104.16.0.0/12;
85+
set_real_ip_from 2400:cb00::/32;
86+
set_real_ip_from 2606:4700::/32;
87+
set_real_ip_from 2803:f800::/32;
88+
set_real_ip_from 2405:b500::/32;
89+
set_real_ip_from 2405:8100::/32;
90+
real_ip_header CF-Connecting-IP;
91+
92+
7193
# SSL PCI Compliance
7294
ssl_session_cache shared:SSL:10m;
7395
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

install/ubuntu/nginx.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ http {
6868
proxy_buffers 32 4k;
6969

7070

71+
# Cloudflare
72+
set_real_ip_from 199.27.128.0/21;
73+
set_real_ip_from 173.245.48.0/20;
74+
set_real_ip_from 103.21.244.0/22;
75+
set_real_ip_from 103.22.200.0/22;
76+
set_real_ip_from 103.31.4.0/22;
77+
set_real_ip_from 141.101.64.0/18;
78+
set_real_ip_from 108.162.192.0/18;
79+
set_real_ip_from 190.93.240.0/20;
80+
set_real_ip_from 188.114.96.0/20;
81+
set_real_ip_from 197.234.240.0/22;
82+
set_real_ip_from 198.41.128.0/17;
83+
set_real_ip_from 162.158.0.0/15;
84+
set_real_ip_from 104.16.0.0/12;
85+
set_real_ip_from 2400:cb00::/32;
86+
set_real_ip_from 2606:4700::/32;
87+
set_real_ip_from 2803:f800::/32;
88+
set_real_ip_from 2405:b500::/32;
89+
set_real_ip_from 2405:8100::/32;
90+
real_ip_header CF-Connecting-IP;
91+
92+
7193
# SSL PCI Compliance
7294
ssl_session_cache shared:SSL:10m;
7395
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

0 commit comments

Comments
 (0)