net-ops/lb-common/overlay/opt/frontend/config/common/haproxy_swamid.j2

44 lines
1.4 KiB
Text
Raw Normal View History

2025-05-14 12:23:40 +02:00
{% extends 'common/haproxy_base.j2' %}
2025-05-06 07:21:55 +02:00
# haproxy for SWAMIDs MDS load balancer nodes.
#
{% from "common/haproxy_macros.j2" import output_backends %}
2025-05-14 12:23:40 +02:00
{% block frontend %}
frontend {{ site_name }}
{{ bind_ip_tls(bind_ips, 443, tls_certificate_bundle) }}
2025-05-06 07:21:55 +02:00
2025-05-14 12:23:40 +02:00
timeout http-request 10s
timeout http-keep-alive 4s
2025-05-14 12:42:12 +02:00
http-request return status 200 content-type "text/plain" file "/opt/frontend/config/common/robots.txt" hdr "cache-control" "no-cache" if { path /robots.txt }
2025-05-06 07:21:55 +02:00
option forwardfor
2025-05-14 12:23:40 +02:00
http-request set-header X-Forwarded-Proto https
2025-05-06 07:21:55 +02:00
2025-05-14 12:23:40 +02:00
{{ web_security_options(['no_frames', 'block_xss', 'hsts', 'no_sniff', 'no_cache']) }}
2025-05-06 07:21:55 +02:00
2025-05-14 12:23:40 +02:00
{{ csp(["default-src " + [csp_app_src]|join(' '),
"script-src " + ["'self'", "'unsafe-inline'"]|join(' '),
"font-src " + ["'self'"]|join(' '),
"style-src " + ["'self'", "'unsafe-inline'"]|join(' '),
"img-src " + ["'self'"]|join(' '),
]) }}
2025-05-06 07:21:55 +02:00
2025-05-14 12:23:40 +02:00
{{ acme_challenge(letsencrypt_server) }}
2025-05-06 07:21:55 +02:00
2025-05-14 12:23:40 +02:00
{% block usebackend %}
2025-05-06 07:21:55 +02:00
use_backend {{ site_name }}__default
2025-05-14 12:23:40 +02:00
{% endblock usebackend %}
2025-05-06 07:21:55 +02:00
{% endblock frontend %}
2025-05-14 13:31:10 +02:00
{% block backend %}
{#
{{ output_backends(backends,
config=[
'cookie SERVERID insert indirect nocache',
'option httpchk'
]
)
}}
{% endblock backend %}
#}