haproxy default page

This commit is contained in:
goeranh 2026-02-28 01:04:24 +01:00
parent 2afb0b0aae
commit 069759f8d9
No known key found for this signature in database

View file

@ -105,23 +105,25 @@
name = "index.html"; name = "index.html";
text = '' text = ''
<html> <html>
<head> <head>
<title> <title>
StuRa HTWD Index StuRa HTWD Index
</title>
</title> </head>
</head> <body>
<body> <p>
<ul> Du hast dich scheinbar verlaufen. Können wir dir hier möglicherweise weiter helfen?
${lib.foldlAttrs ( </p>
prev: name: value: <ul>
prev ${lib.foldlAttrs (
+ '' prev: name: value:
<li><a href="https://${value.domain}">${name}</a></li> prev
'' + ''
) "" forwards} <li><a href="https://${value.domain}">${name}</a></li>
</ul> ''
</body> ) "" forwards}
</ul>
</body>
</html> </html>
''; '';
}; };
@ -190,11 +192,13 @@
${lib.foldlAttrs ( ${lib.foldlAttrs (
prev: name: value: prev: name: value:
prev + "use_backend ${name}_80 if is_${name}\n" prev + ''
use_backend ${name}_80 if is_${name}
http-request redirect scheme https code 301 if !is_acme is_${name}
''
) "" forwards} ) "" forwards}
http-request redirect scheme https code 301 if !is_acme default_backend default_backend
frontend ssh_jump_alt frontend ssh_jump_alt
bind *:2142 bind *:2142
@ -216,6 +220,10 @@
prev + "use_backend ${name}_443 if { req_ssl_sni -i ${value.domain} }\n" prev + "use_backend ${name}_443 if { req_ssl_sni -i ${value.domain} }\n"
) "" forwards} ) "" forwards}
backend default_backend
mode http
http-request return status 200 content-type "text/html" file ${indexPage}
backend ssh_srs2 backend ssh_srs2
mode tcp mode tcp
timeout server 30m timeout server 30m