mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
bw - add REVERSE_PROXY_CUSTOM_HOST setting
This commit is contained in:
parent
ad96dc0fa0
commit
cbb32e7688
2 changed files with 11 additions and 2 deletions
|
|
@ -43,12 +43,12 @@ location {{ url }} {% raw %}{{% endraw +%}
|
|||
etag off;
|
||||
set $backend{{ counter.value }} "{{ host }}";
|
||||
proxy_pass $backend{{ counter.value }};
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Host {% if REVERSE_PROXY_CUSTOM_HOST != "" %}"{{ REVERSE_PROXY_CUSTOM_HOST }}"{% else %}$host{% endif %};
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Protocol $scheme;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Forwarded-Host {% if REVERSE_PROXY_CUSTOM_HOST != "" %}"{{ REVERSE_PROXY_CUSTOM_HOST }}"{% else %}$http_host{% endif %};
|
||||
{% if url.startswith("/") +%}
|
||||
proxy_set_header X-Forwarded-Prefix "{{ url }}";
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -252,6 +252,15 @@
|
|||
"regex": "^(?! )( ?(\\w+)(?!.*\\b\\2\\b))*$",
|
||||
"type": "text",
|
||||
"multiple": "reverse-proxy"
|
||||
},
|
||||
"REVERSE_PROXY_CUSTOM_HOST": {
|
||||
"context": "multisite",
|
||||
"default": "",
|
||||
"help": "Override Host header sent to upstream server.",
|
||||
"id": "reverse-proxy-custom-host",
|
||||
"label": "Reverse proxy custom host",
|
||||
"regex": "^.*$",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue