initial commit
This commit is contained in:
53
angie/j2cfg/00-headers.yml.j2
Normal file
53
angie/j2cfg/00-headers.yml.j2
Normal file
@@ -0,0 +1,53 @@
|
||||
{%- set transparent = false -%}
|
||||
{%- if env.NGX_HTTP_TRANSPARENT_PROXY != None -%}
|
||||
{%- set transparent = (env.NGX_HTTP_TRANSPARENT_PROXY | from_gobool) -%}
|
||||
{%- endif -%}
|
||||
|
||||
---
|
||||
|
||||
request_headers:
|
||||
{%- if transparent %}
|
||||
Host: '$proxy_host'
|
||||
## '$req_accept' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
Accept: '$req_accept'
|
||||
## '$req_user_agent' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
User-Agent: '$req_user_agent'
|
||||
{%- else %}
|
||||
Host: '$host'
|
||||
{%- endif %}
|
||||
|
||||
---
|
||||
|
||||
request_headers:
|
||||
{%- if env.NGX_HTTP_FORWARDED == 'pass' %}
|
||||
## '$proxy_add_forwarded' is defined in /angie/autoconf.dist/http-request-headers-forwarded.conf
|
||||
Forwarded: '$proxy_add_forwarded'
|
||||
{%- elif env.NGX_HTTP_FORWARDED == 'remove' %}
|
||||
Forwarded: ''
|
||||
{%- endif %}
|
||||
|
||||
---
|
||||
|
||||
request_headers:
|
||||
{%- if env.NGX_HTTP_X_FORWARDED == 'pass' %}
|
||||
X-Forwarded-Proto: '$scheme'
|
||||
X-Forwarded-Host: '$host'
|
||||
X-Forwarded-Server: '$host'
|
||||
X-Forwarded-Port: '$server_port'
|
||||
X-Forwarded-For: '$proxy_add_x_forwarded_for'
|
||||
{%- elif env.NGX_HTTP_X_FORWARDED == 'remove' %}
|
||||
X-Forwarded-Proto: ''
|
||||
X-Forwarded-Host: ''
|
||||
X-Forwarded-Server: ''
|
||||
X-Forwarded-Port: ''
|
||||
X-Forwarded-For: ''
|
||||
{%- endif %}
|
||||
|
||||
---
|
||||
|
||||
request_headers:
|
||||
{%- if env.NGX_HTTP_X_REAL_IP == 'pass' %}
|
||||
X-Real-IP: '$remote_addr'
|
||||
{%- elif env.NGX_HTTP_X_REAL_IP == 'remove' %}
|
||||
X-Real-IP: ''
|
||||
{%- endif %}
|
Reference in New Issue
Block a user