mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
[#795] Add setting REVERSE_PROXY_INCLUDES to manually add "include" directives in the reverse proxies
This commit is contained in:
parent
fdb01b3059
commit
a5e0ceed3b
2 changed files with 16 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ add_header X-Proxy-Cache $upstream_cache_status;
|
|||
{% set connect_timeout = all[k.replace("URL", "CONNECT_TIMEOUT")] if k.replace("URL", "CONNECT_TIMEOUT") in all else "60s" %}
|
||||
{% set read_timeout = all[k.replace("URL", "READ_TIMEOUT")] if k.replace("URL", "READ_TIMEOUT") in all else "60s" %}
|
||||
{% set send_timeout = all[k.replace("URL", "SEND_TIMEOUT")] if k.replace("URL", "SEND_TIMEOUT") in all else "60s" %}
|
||||
{% set includes = all[k.replace("URL", "INCLUDES")] if k.replace("URL", "INCLUDES") in all else "" %}
|
||||
location {{ url }} {% raw %}{{% endraw +%}
|
||||
etag off;
|
||||
set $backend{{ counter.value }} "{{ host }}";
|
||||
|
|
@ -88,6 +89,11 @@ location {{ url }} {% raw %}{{% endraw +%}
|
|||
proxy_connect_timeout {{ connect_timeout }};
|
||||
proxy_read_timeout {{ read_timeout }};
|
||||
proxy_send_timeout {{ send_timeout }};
|
||||
{% if includes != "" +%}
|
||||
{% for include in includes.split(" ") +%}
|
||||
include {{ include }};
|
||||
{% endfor +%}
|
||||
{% endif +%}
|
||||
{% raw %}}{% endraw %}
|
||||
{% endif %}
|
||||
{% set counter.value = counter.value + 1 %}
|
||||
|
|
|
|||
|
|
@ -242,6 +242,16 @@
|
|||
"regex": "^\\d+(ms?|[shdwMy])$",
|
||||
"type": "text",
|
||||
"multiple": "reverse-proxy"
|
||||
},
|
||||
"REVERSE_PROXY_INCLUDES": {
|
||||
"context": "multisite",
|
||||
"default": "",
|
||||
"help": "Additional configuration to include in the location block, separated with spaces.",
|
||||
"id": "reverse-proxy-includes",
|
||||
"label": "Reverse proxy includes",
|
||||
"regex": "^(?! )( ?(\\w+)(?!.*\\b\\2\\b))*$",
|
||||
"type": "text",
|
||||
"multiple": "reverse-proxy"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue