diff --git a/root/defaults/nginx/nginx.conf b/root/defaults/nginx/nginx.conf index 05340ea..2f20a8c 100644 --- a/root/defaults/nginx/nginx.conf +++ b/root/defaults/nginx/nginx.conf @@ -30,6 +30,17 @@ http { gzip_min_length 256; gzip_types text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml; + # Get client IP from behind reverse proxy + real_ip_header X-Forwarded-For; + real_ip_recursive on; + + # Allowed reverse proxy server IP ranges + set_real_ip_from 10.0.0.0/8; + set_real_ip_from 172.16.0.0/12; + set_real_ip_from 192.168.0.0/16; + set_real_ip_from 127.0.0.0/8; + set_real_ip_from fd00::/8; + upstream php-handler { server unix:/var/run/php-fpm/php-fpm.sock; }