81 lines
2.1 KiB
Nix
81 lines
2.1 KiB
Nix
let
|
|
domain = "martials.no";
|
|
in
|
|
{
|
|
services.caddy = {
|
|
enable = true;
|
|
email = "cert@${domain}";
|
|
virtualHosts =
|
|
let
|
|
reverseProxy = port: "reverse_proxy localhost:${builtins.toString port}";
|
|
in
|
|
{
|
|
"beta.${domain}".extraConfig = ''
|
|
redir https://${domain}{uri}
|
|
'';
|
|
"git.${domain}".extraConfig = ''
|
|
redir https://code.${domain}{uri}
|
|
'';
|
|
# Gitea
|
|
"code.${domain}".extraConfig = ''
|
|
${reverseProxy 3000}
|
|
'';
|
|
# Nextcloud
|
|
"nextcloud.${domain}".extraConfig = ''
|
|
redir /.well-known/carddav /remote.php/dav 301
|
|
redir /.well-known/caldav /remote.php/dav 301
|
|
${reverseProxy 11000}
|
|
'';
|
|
# Kitchenowl
|
|
"kitchenowl.${domain}".extraConfig = ''
|
|
${reverseProxy 800}
|
|
'';
|
|
# Actual Budget
|
|
"budget.${domain}".extraConfig = ''
|
|
${reverseProxy 5006}
|
|
'';
|
|
# Uptime Kuma
|
|
"status.${domain}".extraConfig = ''
|
|
${reverseProxy 3001}
|
|
'';
|
|
# Headscale
|
|
"vpn.${domain}".extraConfig = ''
|
|
reverse_proxy /web* localhost:8084
|
|
reverse_proxy * localhost:8082
|
|
'';
|
|
# Headscale SmartDNS
|
|
"dns.${domain}".extraConfig = ''
|
|
${reverseProxy 8082}
|
|
'';
|
|
# FreshRSS
|
|
"rss.${domain}".extraConfig = ''
|
|
${reverseProxy 8085}
|
|
'';
|
|
# Ente backend
|
|
"api.ente.${domain}".extraConfig = ''
|
|
${reverseProxy 8083}
|
|
'';
|
|
# Ente Photos frontend
|
|
"ente.${domain}".extraConfig = ''
|
|
${reverseProxy 3003}
|
|
'';
|
|
# Ente Auth frontend
|
|
"mfa.${domain}".extraConfig = ''
|
|
${reverseProxy 3004}
|
|
'';
|
|
# Homepage / portfolio
|
|
"${domain}".extraconfig = ''
|
|
${reverseProxy 4321}
|
|
'';
|
|
# Yamtrack
|
|
"track.${domain}".extraConfig = ''
|
|
${reverseProxy 8090}
|
|
'';
|
|
# Postal
|
|
"mail.${domain}".extraConfig = ''
|
|
${reverseProxy 5000}
|
|
'';
|
|
};
|
|
};
|
|
}
|