From e62532957509e7f6fae4a24964c14886c9eb649a Mon Sep 17 00:00:00 2001 From: Tai Lee Date: Thu, 15 Nov 2018 10:47:55 +1100 Subject: [PATCH] Trust real IP from any private network address (e.g. haproxy running on another container). --- ixc_django_docker/etc/nginx.tmpl.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ixc_django_docker/etc/nginx.tmpl.conf b/ixc_django_docker/etc/nginx.tmpl.conf index 31a4cc9..eb49d8c 100644 --- a/ixc_django_docker/etc/nginx.tmpl.conf +++ b/ixc_django_docker/etc/nginx.tmpl.conf @@ -35,6 +35,9 @@ http { real_ip_header X-Forwarded-For; real_ip_recursive on; set_real_ip_from 127.0.0.1; + 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; # Support websockets. proxy_http_version 1.1;