diff --git a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml index d80d495cf..33407457c 100644 --- a/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml +++ b/www/caddy/src/opnsense/mvc/app/controllers/OPNsense/Caddy/forms/dialogHandle.xml @@ -340,4 +340,111 @@ false + + handle.health_uri + + text + + + + false + + + + handle.health_upstream + + text + + + + false + + + + handle.health_port + + text + + + + false + + + + handle.health_interval + + text + + 30 + + + false + + + + handle.health_passes + + text + + 1 + + + false + + + + handle.health_fails + + text + + 1 + + + false + + + + handle.health_timeout + + text + + 5 + + + false + + + + handle.health_status + + text + + 200 + + + false + + + + handle.health_body + + text + + + + false + + + + handle.health_follow_redirects + + checkbox + + + + false + boolean + boolean + + diff --git a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml index b86ec3044..3bf5aa4c3 100644 --- a/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml +++ b/www/caddy/src/opnsense/mvc/app/models/OPNsense/Caddy/Caddy.xml @@ -457,6 +457,38 @@ Please enter a minimum value of 1 or leave empty for defaults. + + /^(\/.*)?$/u + Please enter a valid 'URI' that starts with '/'. + + + + 1 + 65535 + Please enter a minimum value of 1-65535 or leave empty for defaults. + + + 1 + Please enter a minimum value of 1 or leave empty for defaults. + + + 1 + Please enter a minimum value of 1 or leave empty for defaults. + + + 1 + Please enter a minimum value of 1 or leave empty for defaults. + + + 1 + Please enter a minimum value of 1 or leave empty for defaults. + + + /^(100|[1-5][0-9]{2}|[1-5]xx)$/u + Please enter a 3-digit status code or a status code ending in xx or leave empty for defaults. + + + diff --git a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile index da616b4ed..b8fc14f8c 100644 --- a/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile +++ b/www/caddy/src/opnsense/service/templates/OPNsense/Caddy/Caddyfile @@ -415,6 +415,36 @@ http://{{ domain }} { {% if handle.lb_try_interval|default("") %} lb_try_interval {{ handle.lb_try_interval }}ms {% endif %} + {% if handle.health_uri|default("") %} + health_uri {{ handle.health_uri }} + {% endif %} + {% if handle.health_upstream|default("") %} + health_uri {{ handle.health_upstream }} + {% endif %} + {% if handle.health_port|default("") %} + health_uri {{ handle.health_port }} + {% endif %} + {% if handle.health_interval|default("") %} + health_uri {{ handle.health_interval }}s + {% endif %} + {% if handle.health_passes|default("") %} + health_uri {{ handle.health_passes }} + {% endif %} + {% if handle.health_fails|default("") %} + health_uri {{ handle.health_fails }} + {% endif %} + {% if handle.health_timeout|default("") %} + health_uri {{ handle.health_timeout }}s + {% endif %} + {% if handle.health_status|default("") %} + health_uri {{ handle.health_status }} + {% endif %} + {% if handle.health_body|default("") %} + health_uri {{ handle.health_body }} + {% endif %} + {% if handle.health_follow_redirects|default("0") == "1" %} + health_follow_redirects + {% endif %} {% if handle.PassiveHealthFailDuration|default("") %} fail_duration {{ handle.PassiveHealthFailDuration }}s {% endif %}