nginx_site: Add load balance method config option
This commit is contained in:
parent
11ddc0397a
commit
6e72234b1d
1 changed files with 9 additions and 6 deletions
|
@ -1,13 +1,16 @@
|
|||
{% if nginx_site_proxy is defined and nginx_site_proxy is not string %}
|
||||
upstream {{ nginx_site_name }} {
|
||||
{% for item in nginx_site_proxy %}
|
||||
{% set item = item | regex_replace("^(https://)?([^/]*).*$", "\\2") %}
|
||||
{% if item | regex_search(".*:[0-9]+$") %}
|
||||
{% if nginx_site_load_balance_method is defined %}
|
||||
{{ nginx_site_load_balance_method }};
|
||||
{% endif %}
|
||||
{% for item in nginx_site_proxy %}
|
||||
{% set item = item | regex_replace("^(https://)?([^/]*).*$", "\\2") %}
|
||||
{% if item | regex_search(".*:[0-9]+$") %}
|
||||
server {{ item }};
|
||||
{% else %}
|
||||
{% else %}
|
||||
server {{ item }}:443;
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
server {
|
||||
|
|
Loading…
Add table
Reference in a new issue