public-web-static: add configuration for www.didays.de redirect

This commit is contained in:
June 2026-09-28 21:25:19 +02:00
commit 3f8bff392f
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

View file

@ -9,6 +9,9 @@ in {
"acme-${domain}" = {
enableACME = true;
serverName = "${domain}";
serverAliases = [
"www.${domain}"
];
listen = [
{
@ -22,6 +25,41 @@ in {
];
};
"www.${domain}" = {
forceSSL = true;
useACMEHost = "${domain}";
listen = [
{
addr = "[::]";
port = 8443;
ssl = true;
proxyProtocol = true;
}
{
addr = "0.0.0.0";
port = 8443;
ssl = true;
proxyProtocol = true;
}
];
locations."/" = {
return = "302 https://didays.de$request_uri";
};
extraConfig = ''
# Make use of the ngx_http_realip_module to set the $remote_addr and
# $remote_port to the client address and client port, when using proxy
# protocol.
# First set our proxy protocol proxy as trusted.
set_real_ip_from 172.31.17.140;
# Then tell the realip_module to get the addreses from the proxy protocol
# header.
real_ip_header proxy_protocol;
'';
};
"${domain}" = {
forceSSL = true;
useACMEHost = "${domain}";