forked from pub-solar/os
56 lines
1.2 KiB
Nix
56 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
self,
|
|
...
|
|
}: {
|
|
services.caddy = {
|
|
enable = lib.mkForce true;
|
|
group = "www-user";
|
|
email = "admins@pub.solar";
|
|
globalConfig = lib.mkForce "";
|
|
virtualHosts = {
|
|
"momo.koeln" = {
|
|
logFormat = lib.mkForce ''
|
|
output discard
|
|
'';
|
|
extraConfig = ''
|
|
# website
|
|
handle {
|
|
root * /srv/www/momo.koeln
|
|
try_files {path}.html {path}
|
|
file_server
|
|
}
|
|
# minimal error handling, respond with status code and text
|
|
handle_errors {
|
|
respond "{http.error.status_code} {http.error.status_text}"
|
|
}
|
|
'';
|
|
};
|
|
"www.momo.koeln" = {
|
|
logFormat = lib.mkForce ''
|
|
output discard
|
|
'';
|
|
extraConfig = ''
|
|
redir https://momo.koeln{uri}
|
|
'';
|
|
};
|
|
"list.momo.koeln" = {
|
|
logFormat = lib.mkForce ''
|
|
output discard
|
|
'';
|
|
extraConfig = ''
|
|
handle_path /static/* {
|
|
root * /var/lib/mailman/web
|
|
file_server
|
|
}
|
|
|
|
reverse_proxy :8000
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
networking.firewall.allowedTCPPorts = [80 443];
|
|
}
|