katzen-cafe/modules/proxy.nix

221 lines
5.7 KiB
Nix
Raw Normal View History

2023-12-09 22:06:23 +01:00
{pkgs, ...}: {
2023-04-25 15:57:59 +02:00
security.acme = {
acceptTerms = true;
defaults = {
email = "jade@schrottkatze.de";
webroot = "/var/lib/acme/acme-challenge";
};
certs = {
"meet.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
"vw.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-08-05 18:46:25 +02:00
"miau.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-05-03 14:38:40 +02:00
"forge.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-04-30 14:56:30 +02:00
"wiki.phtanum-b.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-07-30 16:24:46 +02:00
"wiki.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-04-27 01:48:20 +02:00
"auth.katzen.cafe" = {
2023-04-26 23:25:04 +02:00
group = "nginx";
keyType = "rsa4096";
};
"design.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-05-06 03:19:19 +02:00
"ck.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-07-30 18:19:44 +02:00
"mumble.katzen.cafe" = {
group = "murmur";
keyType = "rsa4096";
};
2023-07-30 16:24:46 +02:00
"hc-vault.katzen.cafe" = {
group = "nginx";
2023-05-08 07:17:06 +02:00
keyType = "rsa4096";
};
2023-07-30 16:24:46 +02:00
"grafana.katzen.cafe" = {
2023-05-22 19:02:49 +02:00
group = "nginx";
keyType = "rsa4096";
};
2023-08-05 18:46:25 +02:00
"wolke.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2024-02-21 09:25:07 +01:00
"wp.schule.katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-05-21 14:51:02 +02:00
# "prosody.katzen.cafe" = {
# group = "prosody";
# keyType = "rsa4096";
2023-12-09 22:06:23 +01:00
# extraDomainNames = [
2023-05-21 14:51:02 +02:00
# "uploads.prosody.katzen.cafe"
# "conference.prosody.katzen.cafe"
# ];
# };
2023-04-26 23:25:04 +02:00
};
};
2023-12-09 22:06:23 +01:00
users.users.nginx.extraGroups = ["acme"];
2023-04-26 23:25:04 +02:00
services.nginx = {
enable = true;
2023-12-09 22:06:23 +01:00
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedTlsSettings = true;
recommendedProxySettings = true;
2023-07-30 16:24:46 +02:00
statusPage = true;
2023-04-26 23:25:04 +02:00
virtualHosts = {
2023-08-05 18:46:25 +02:00
"miau.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = "/var/www/miau";
};
};
2023-07-30 18:19:44 +02:00
"_.katzen.cafe" = {
# Catchall vhost, will redirect users to HTTPS for all vhosts
2023-12-09 22:06:23 +01:00
serverAliases = ["*.katzen.cafe"];
2023-07-30 18:19:44 +02:00
locations."/.well-known/acme-challenge" = {
root = "/var/lib/acme/acme-challenge";
};
locations."/" = {
return = "301 https://$host$request_uri";
2023-08-05 18:46:25 +02:00
root = "/var/www/miau";
2023-07-30 18:19:44 +02:00
};
2023-12-09 22:06:23 +01:00
};
2023-07-30 16:24:46 +02:00
"grafana.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:2343";
proxyWebsockets = true;
};
};
"vw.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
2023-12-09 22:06:23 +01:00
proxyPass = "http://localhost:8812";
proxyWebsockets = true;
};
locations."/notifications/hub" = {
proxyPass = "http://localhost:3012";
proxyWebsockets = true;
};
locations."/notifications/hub/negotiate" = {
proxyPass = "http://localhost:8812";
proxyWebsockets = true;
};
};
2023-05-06 03:19:19 +02:00
"ck.katzen.cafe" = {
2023-04-30 14:56:30 +02:00
forceSSL = true;
enableACME = true;
locations."/" = {
2023-05-06 03:19:19 +02:00
proxyPass = "http://127.0.0.1:3000";
proxyWebsockets = true;
extraConfig = ''
2023-12-09 22:06:23 +01:00
client_max_body_size 8M;
2023-05-06 03:19:19 +02:00
2023-12-09 22:06:23 +01:00
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
'';
2023-04-30 14:56:30 +02:00
};
};
2023-11-21 10:19:35 +01:00
"pad.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:3001";
proxyWebsockets = true;
};
};
2023-05-03 14:38:40 +02:00
"forge.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8082";
};
};
2023-04-26 23:25:04 +02:00
"auth.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
2023-07-30 18:19:44 +02:00
proxyPass = "http://127.0.0.3:8080";
2023-12-09 22:06:23 +01:00
# proxy_set_header Host $host;
extraConfig = ''
2023-12-09 22:06:23 +01:00
proxy_buffers 4 256k;
proxy_buffer_size 128k;
proxy_busy_buffers_size 256k;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_protocol_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
};
#extraConfig = ''
2023-12-09 22:06:23 +01:00
#'';
};
"design.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
2023-05-06 03:19:19 +02:00
proxyPass = "http://127.0.0.1:9001";
proxyWebsockets = true;
2023-04-26 23:25:04 +02:00
};
};
2023-07-30 16:24:46 +02:00
"wiki.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://10.0.2.2";
};
};
2023-05-06 03:19:19 +02:00
"wiki.phtanum-b.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
2023-07-30 16:24:46 +02:00
proxyPass = "http://10.0.1.2";
2023-05-06 03:19:19 +02:00
};
};
2023-08-05 18:46:25 +02:00
"wolke.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://10.0.3.2";
};
extraConfig = ''
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
2023-12-09 22:06:23 +01:00
'';
2023-08-05 18:46:25 +02:00
};
2024-02-21 09:25:07 +01:00
"wp.schule.katzen.cafe" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://10.0.4.2";
};
};
2023-04-25 15:57:59 +02:00
};
};
}