diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml index c5959903d..600c1cb13 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogBackend.xml @@ -117,6 +117,13 @@ true + + backend.tuning_timeoutCheck + + text + + true + backend.tuning_timeoutServer diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml index 90306c092..d5c7fd421 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/dialogServer.xml @@ -80,6 +80,13 @@ true + + server.checkDownInterval + + text + + true + server.checkport diff --git a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml index 17dc73ead..33aa176c7 100644 --- a/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml +++ b/net/haproxy/src/opnsense/mvc/app/controllers/OPNsense/HAProxy/forms/main.xml @@ -108,6 +108,12 @@ text + + haproxy.general.defaults.timeoutCheck + + text + + haproxy.general.defaults.timeoutServer diff --git a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml index a9cfc9477..b41478f25 100644 --- a/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml +++ b/net/haproxy/src/opnsense/mvc/app/models/OPNsense/HAProxy/HAProxy.xml @@ -94,6 +94,11 @@ Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N + + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + 30s /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u @@ -484,6 +489,11 @@ Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". N + + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u + Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". + N + /^([0-9]{1,8}(?:us|ms|s|m|h|d)?)/u Should be a number between 1 and 8 characters, optionally followed by either "d", "h", "m", "s", "ms" or "us". @@ -607,6 +617,12 @@ Please specify a value between 500 and 100000. Y + + 500 + 100000 + Please specify a value between 500 and 100000. + N + /^((([0-9a-zA-Z._\-\*]+:[0-9]+(-[0-9]+)?)([,]){0,1}))*/u Please specify a valid source address, i.e. 10.0.0.1 or loadbalancer.example.com:50000. Port range as start-end, i.e. 10.0.0.1:50000-60000. diff --git a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf index ca33c3408..a799f4175 100644 --- a/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf +++ b/net/haproxy/src/opnsense/service/templates/OPNsense/HAProxy/haproxy.conf @@ -524,6 +524,9 @@ defaults {% if OPNsense.HAProxy.general.defaults.timeoutConnect|default("") != "" %} timeout connect {{OPNsense.HAProxy.general.defaults.timeoutConnect}} {% endif %} +{% if OPNsense.HAProxy.general.defaults.timeoutCheck|default("") != "" %} + timeout check {{OPNsense.HAProxy.general.defaults.timeoutCheck}} +{% endif %} {% if OPNsense.HAProxy.general.defaults.timeoutServer|default("") != "" %} timeout server {{OPNsense.HAProxy.general.defaults.timeoutServer}} {% endif %} @@ -749,6 +752,11 @@ backend {{backend.name}} {% elif OPNsense.HAProxy.general.defaults.timeoutConnect is defined %} timeout connect {{OPNsense.HAProxy.general.defaults.timeoutConnect}} {% endif %} +{% if backend.tuning_timeoutCheck|default("") != "" %} + timeout check {{backend.tuning_timeoutCheck}} +{% elif OPNsense.HAProxy.general.defaults.timeoutCheck is defined %} + timeout check {{OPNsense.HAProxy.general.defaults.timeoutCheck}} +{% endif %} {% if backend.tuning_timeoutServer|default("") != "" %} timeout server {{backend.tuning_timeoutServer}} {% elif OPNsense.HAProxy.general.defaults.timeoutServer is defined %} @@ -784,6 +792,10 @@ backend {{backend.name}} {% if healthcheck_enabled == '1' %} {% do server_options.append('check') %} {% do server_options.append('inter ' ~ server_data.checkInterval) %} +{# # use a different interval when server is in DOWN state #} +{% if server_data.checkDownInterval|default("") != "" %} +{% do server_options.append('downinter ' ~ server_data.checkDownInterval) %} +{% endif %} {# # use a different port for health check #} {% if healthcheck_data.checkport|default("") != "" %} {# # prefer port from health check template #}