nginx_site: Add load balance method config option

This commit is contained in:
Timo Makinen 2024-12-07 15:24:41 +00:00
parent 11ddc0397a
commit 6e72234b1d

View file

@ -1,5 +1,8 @@
{% if nginx_site_proxy is defined and nginx_site_proxy is not string %} {% if nginx_site_proxy is defined and nginx_site_proxy is not string %}
upstream {{ nginx_site_name }} { upstream {{ nginx_site_name }} {
{% if nginx_site_load_balance_method is defined %}
{{ nginx_site_load_balance_method }};
{% endif %}
{% for item in nginx_site_proxy %} {% for item in nginx_site_proxy %}
{% set item = item | regex_replace("^(https://)?([^/]*).*$", "\\2") %} {% set item = item | regex_replace("^(https://)?([^/]*).*$", "\\2") %}
{% if item | regex_search(".*:[0-9]+$") %} {% if item | regex_search(".*:[0-9]+$") %}