From 01ad4658abe6add2ee6282432b0d3d3e5d22d135 Mon Sep 17 00:00:00 2001 From: Tilo Spannagel Date: Tue, 3 Apr 2018 09:40:53 +0200 Subject: [PATCH] nginx: set the remote ip from X-Real-IP by default (#302) --- .../with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf | 5 +++++ .../with-nginx-proxy/mariadb/fpm/web/nginx.conf | 5 +++++ .../with-nginx-proxy/postgres/fpm/web/nginx.conf | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf index 0b6fb89..eb67c0f 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb-cron-redis/fpm/web/nginx.conf @@ -25,6 +25,11 @@ http { keepalive_timeout 65; + 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; + real_ip_header X-Real-IP; + #gzip on; upstream php-handler { diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf index 0b6fb89..eb67c0f 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf @@ -25,6 +25,11 @@ http { keepalive_timeout 65; + 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; + real_ip_header X-Real-IP; + #gzip on; upstream php-handler { diff --git a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf index 0b6fb89..eb67c0f 100644 --- a/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf +++ b/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf @@ -25,6 +25,11 @@ http { keepalive_timeout 65; + 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; + real_ip_header X-Real-IP; + #gzip on; upstream php-handler {