diff --git a/group_vars/all.yml b/group_vars/all.yml index fe12d2a..3b0f352 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -35,6 +35,7 @@ haproxy: - hass.badjware.dev - longhorn.badjware.dev - traefik.badjware.dev + - prometheus.badjware.dev backend: - server: 192.168.20.20 - server: 192.168.20.21 diff --git a/roles/haproxy/templates/haproxy.cfg b/roles/haproxy/templates/haproxy.cfg index 33a2b27..97b448f 100644 --- a/roles/haproxy/templates/haproxy.cfg +++ b/roles/haproxy/templates/haproxy.cfg @@ -62,15 +62,10 @@ frontend https_in # set X-Forwarded-Proto http-request set-header X-Forwarded-Proto https - # request is ssl - # tcp-request inspect-delay 5s - # tcp-request content accept if { req.ssl_hello_type 1 } - default_backend default_backend {% for http_route in https_routing %} - #use_backend https_{{ http_route.frontend[0]|replace('.','_') }} if { req.ssl_sni -i {% for src in http_route.frontend %}{{ src }} {% endfor %}} - use_backend https_{{ http_route.frontend[0]|replace('.','_') }} if { hdr_end(host) -i {% for src in http_route.frontend %}{{ src }} {% endfor %}}{% if 'allowlist' in http_route %} { src {% for ip in http_route.allowlist %}{{ ip }} {% endfor %}}{% endif %} + use_backend https_{{ http_route.frontend[0]|replace('.','_') }} if { hdr_end(host) -i {% for src in http_route.frontend %}{{ src }} {% endfor %}}{% if 'allowlist' in http_route %} { src {% for ip in http_route.allowlist %}{{ ip }} {% endfor %}}{% endif %} {% endfor %} ## BACKENDS ## @@ -98,13 +93,13 @@ backend https_{{ http_route.frontend[0]|replace('.','_') }} mode http balance roundrobin {% for dst in http_route.backend %} - server {{ dst.server }} {{ dst.server }}{% if ':' not in dst.server %}:443{% endif %} check {% if http_route.ssl|default(true) %}ssl verify none alpn h2,http/1.1{% endif %} {{ dst.extra_param|default('') }} - + server {{ dst.server }} {{ dst.server }}{% if ':' not in dst.server %}:443{% endif %} check {% if http_route.ssl|default(true) %}ssl verify none alpn h2,http/1.1{% endif %} {{ dst.extra_param|default('') }} {% endfor %} {% endfor %} ## TCP ## + {% for tcp_route in tcp_routing %} frontend tcp_{{ tcp_route.frontend }} bind *:{{ tcp_route.frontend }}