Commit 5e5a5496 authored by Michael Iseard's avatar Michael Iseard
Browse files

Add cloudflare real_ip

parent 6af2c2ef
server {
listen 80;
server_name 127.0.0.1;
root /var/www/html;
......@@ -6,6 +7,7 @@ server {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
include snippets/cloudflare.conf;
include snippets/wordpress.conf;
}
#https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs-Logging-visitor-IP-addresses-with-mod-cloudflare-
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 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
real_ip_header CF-Connecting-IP;
add_header CF-Connecting-IP $http_cf_connecting_ip always;
add_header CF-IPCountry $http_cf_connecting_ip always;
......@@ -98,6 +98,7 @@ gzip_types text/plain text/css application/json application/javascript applicati
location ~ \.php$ {
try_files $uri =404;
fastcgi_param HTTPS 'on';
fastcgi_param REMOTE_ADDR $http_x_real_ip;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass wordpress:9000;
fastcgi_index index.php;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment