nix-configs/schrottserver/proxy.nix

134 lines
3.4 KiB
Nix
Raw Normal View History

2023-02-03 23:06:00 +01:00
{ inputs, config, pkgs, ... }:
2023-02-04 01:14:39 +01:00
{
2023-02-03 23:06:00 +01:00
security.acme = {
acceptTerms = true;
defaults.email = "jade@schrottkatze.de";
certs = {
2023-02-06 10:51:15 +01:00
"schrottkatze.de" = {
group = "nginx";
keyType = "rsa4096";
2023-02-06 10:51:15 +01:00
};
2023-04-12 14:17:06 +02:00
"katzen.cafe" = {
group = "nginx";
keyType = "rsa4096";
};
2023-02-04 01:14:39 +01:00
"vw.schrottkatze.de" = {
2023-02-03 23:06:00 +01:00
group = "nginx";
keyType = "rsa4096";
2023-02-03 23:06:00 +01:00
};
2023-02-06 10:51:15 +01:00
"wolke.schrottkatze.de" = {
group = "nginx";
keyType = "rsa4096";
2023-02-06 10:51:15 +01:00
};
2023-02-16 12:11:05 +01:00
"s10e.de" = {
group = "nginx";
keyType = "rsa4096";
2023-02-16 12:11:05 +01:00
};
2023-02-19 02:04:30 +01:00
"synapse.schrottkatze.de" = {
group = "nginx";
keyType = "rsa4096";
2023-02-19 02:27:09 +01:00
};
2023-03-05 10:56:03 +01:00
"pp.schrottkatze.de" = {
group = "nginx";
keyType = "rsa4096";
2023-03-05 10:56:03 +01:00
};
2023-02-03 23:06:00 +01:00
};
};
2023-04-12 14:17:06 +02:00
environment.systemPackages = [ inputs.meowsite.packages."x86_64-linux".default inputs.gumseite.packages."x86_64-linux".default ];
2023-02-06 10:51:15 +01:00
2023-02-03 23:06:00 +01:00
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
2023-02-06 10:51:15 +01:00
"schrottkatze.de" = {
forceSSL = true;
enableACME = true;
root = "${inputs.meowsite.packages."x86_64-linux".default}";
};
2023-04-12 14:17:06 +02:00
"katzen.cafe" = {
forceSSL = true;
enableACME = true;
root = "${inputs.gumseite.packages."x86_64-linux".default}";
};
2023-02-04 01:14:39 +01:00
"vw.schrottkatze.de" = {
2023-02-03 23:06:00 +01:00
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:8812"; #changed the default rocket port due to some conflict
proxyWebsockets = true;
};
locations."/notifications/hub" = {
proxyPass = "http://localhost:3012";
proxyWebsockets = true;
};
locations."/notifications/hub/negotiate" = {
proxyPass = "http://localhost:8812";
proxyWebsockets = true;
};
};
2023-02-04 01:14:39 +01:00
"wolke.schrottkatze.de" = {
forceSSL = true;
enableACME = true;
};
2023-03-05 10:56:03 +01:00
"pp.schrottkatze.de" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:9001";
2023-03-06 20:00:42 +01:00
proxyWebsockets = true;
2023-03-05 10:56:03 +01:00
};
};
2023-02-16 12:11:05 +01:00
"s10e.de" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8080$request_uri";
};
};
2023-02-19 02:04:30 +01:00
"synapse.schrottkatze.de" = {
forceSSL = true;
enableACME = true;
http2 = true;
listen = [
{
2023-02-19 02:27:09 +01:00
addr = "0.0.0.0";
port = 443;
ssl = true;
}
{
addr = "[::]";
2023-02-19 02:04:30 +01:00
port = 443;
ssl = true;
}
{
2023-02-19 02:27:09 +01:00
addr = "0.0.0.0";
port = 8448;
ssl = true;
}
{
addr = "[::]";
2023-02-19 02:04:30 +01:00
port = 8448;
ssl = true;
}
];
2023-02-19 02:27:09 +01:00
locations."~ ^(/_matrix|/_synapse/client)" = {
2023-02-19 02:04:30 +01:00
proxyPass = "http://localhost:8008";
2023-02-19 02:27:09 +01:00
extraConfig = ''
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
client_max_body_size 2G;
'';
2023-02-19 02:04:30 +01:00
};
2023-02-19 02:27:09 +01:00
extraConfig = "proxy_http_version 1.1;";
2023-02-19 02:04:30 +01:00
};
2023-02-03 23:06:00 +01:00
};
};
}