http { | http { | ||||
{% if 'set_real_ips' in nginx -%} | {% if 'set_real_ips' in nginx -%} | ||||
{% for ip in nginx.get('set_real_ips', {}).get('ips', []) -%} | |||||
{% for ip in nginx.get('set_real_ips', {}).get('from_ips', []) -%} | |||||
set_real_ip_from {{ ip }}; | set_real_ip_from {{ ip }}; | ||||
{% endfor -%} | {% endfor -%} | ||||
real_ip_header {{ nginx.get('set_real_ips', {}).get('real_ip_header', 'X-Forwarded-For') }}; | real_ip_header {{ nginx.get('set_real_ips', {}).get('real_ip_header', 'X-Forwarded-For') }}; |
with_luajit: False | with_luajit: False | ||||
with_openresty: True | with_openresty: True | ||||
set_real_ips: # NOTE: to use this, nginx must have http_realip module enabled | set_real_ips: # NOTE: to use this, nginx must have http_realip module enabled | ||||
ips: | |||||
from_ips: | |||||
- 10.10.10.0/24 | - 10.10.10.0/24 | ||||
real_ip_header: X-Forwarded-For | real_ip_header: X-Forwarded-For | ||||
modules: | modules: |