fix(Issue: 2111) Apply loadbalancing for UDP (#2247)

This commit is contained in:
Thomas Laubrock
2021-04-10 10:29:29 +02:00
committed by GitHub
parent ff9fff5b03
commit f7fda26ebb
@@ -9,7 +9,11 @@
# UPSTREAM SERVERS
{% for upstream in helpers.toList('OPNsense.Nginx.upstream') %}
upstream upstream{{ upstream['@uuid'].replace('-','') }} {
hash $remote_addr consistent;
{% if upstream.load_balancing_algorithm is defined and upstream.load_balancing_algorithm != '' %}
{% if upstream.load_balancing_algorithm == 'ip_hash' %}
hash $remote_addr consistent;
{% endif %}
{% endif %}
{% for upstream_serveruuid in upstream.serverentries.split(',') %}
{% set upstream_server = helpers.getUUID(upstream_serveruuid) %}
server {% if ':' in upstream_server.server %}[{% endif %}{{ upstream_server.server }}{% if ':' in upstream_server.server %}]{% endif