1
0

conf: realip module

This commit is contained in:
2025-06-19 12:05:36 +03:00
parent 778fe4855f
commit 7525b5847a
5 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{%- set hdr = j2cfg.headers.real_ip_from or 'off' -%}
{%- if hdr != 'off' %}
real_ip_header {{ hdr | http_header }};
{% include 'realip-set-from.j2inc' %}
{%- endif %}

View File

@@ -0,0 +1 @@
{% include 'realip-set-from.j2inc' %}

View File

@@ -0,0 +1,8 @@
{%- set src = (j2cfg.trusted_sources or []) | any_to_str_list | uniq_str_list | ngx_esc -%}
{%- if src %}
{%- for s in src %}
set_real_ip_from {{ s }};
{%- endfor %}
{%- else %}
set_real_ip_from unix: ;
{%- endif %}

View File

@@ -0,0 +1 @@
{% include 'realip-set-from.j2inc' %}