Opened 4 years ago

Closed 3 years ago

#1180 closed enhancement (fixed)

Allow use of hostnames in set_real_ip_from

Reported by: mmitar@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.9.x
Keywords: Cc: mmitar@…
uname -a: Linux web 4.8.0-34-generic #36~16.04.1-Ubuntu SMP Wed Dec 21 18:55:08 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.1
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-JCHwcf/nginx-1.10.1/debian/modules/nginx-auth-pam --add-module=/build/nginx-JCHwcf/nginx-1.10.1/debian/modules/nginx-dav-ext-module --add-dynamic-module=/build/nginx-JCHwcf/nginx-1.10.1/debian/modules/nginx-echo --add-dynamic-module=/build/nginx-JCHwcf/nginx-1.10.1/debian/modules/nginx-upstream-fair --add-dynamic-module=/build/nginx-JCHwcf/nginx-1.10.1/debian/modules/ngx_http_substitutions_filter_module

Description

I use nginx inside Docker containers and I also use a Docker container for reverse proxy which then forwards requests to those other Docker containers. Because I would like to be able to specify move containers around and change their internal IPs, I am looking into how to configure nginx inside Docker containers with a hostname for set_real_ip_from, so that as the reverse proxy moves around, its correct internal IP is used.

It seems this could be resolved by allowing variables inside set_real_ip_from. Or by simply allowing hostnames for set_real_ip_from.

Change History (2)

comment:1 by Ruslan Ermilov <ru@…>, 3 years ago

In 6997:df1a62c83b1b/nginx:

Realip: allow hostnames in set_real_ip_from (ticket #1180).

comment:2 by Ruslan Ermilov, 3 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.