nginx/site: Allow using url format for multiple proxies
This commit is contained in:
parent
5f8371eb12
commit
6f12feebc3
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
{% if proxy is defined and proxy is not string %}
|
||||
upstream upstream_{{ site }} {
|
||||
{% for item in proxy %}
|
||||
{% set item = item | regex_replace("^(https://)?([^/]*).*$", "\\2") %}
|
||||
{% if item | regex_search(".*:[0-9]+$") %}
|
||||
server {{ item }};
|
||||
{% else %}
|
||||
|
@ -35,9 +36,10 @@ server {
|
|||
{% elif proxy is defined %}
|
||||
location / {
|
||||
{% if proxy is not string %}
|
||||
{% set path = proxy[0] | regex_replace("^(https://)?([^/]*)(.*)$", "\\3") %}
|
||||
# https://trac.nginx.org/nginx/ticket/1307
|
||||
proxy_ssl_verify off;
|
||||
proxy_pass https://upstream_{{ site }};
|
||||
proxy_pass https://upstream_{{ site }}{{ path }};
|
||||
{% else %}
|
||||
proxy_pass {{ proxy }};
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Reference in a new issue