mastodon: use nixos' mastodon nginx config

This commit is contained in:
Astro 2022-11-30 01:13:23 +01:00
parent a4474a5f39
commit 9e97c34038
1 changed files with 9 additions and 22 deletions

View File

@ -23,29 +23,16 @@
# echo "${secrets.email.smtp-password}" > $out
# ''}";
extraConfig.WEB_DOMAIN = "c3d2.social";
extraConfig = {
ALTERNATE_DOMAINS = lib.concatStringsSep "," [
"${config.networking.hostName}.serv.zentralwerk.org"
];
DEFAULT_LOCALE = "de";
};
configureNginx = true;
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
services.nginx = {
enable = true;
virtualHosts."c3d2.social" = {
root = "${config.services.mastodon.package}/public/";
forceSSL = true;
enableACME = true;
locations."/system/".alias = "/var/lib/mastodon/public-system/";
locations."/".tryFiles = "$uri @proxy";
locations."@proxy".proxyPass = "http://unix:/run/mastodon-web/web.socket";
locations."@proxy".proxyWebsockets = true;
locations."/api/v1/streaming/".proxyPass = "http://unix:/run/mastodon-streaming/streaming.socket";
locations."/api/v1/streaming/".proxyWebsockets = true;
};
};
users.groups.mastodon.members = [ config.services.nginx.user ];
}