2022-10-12 19:58:09 +01:00
|
|
|
{config, ...}: {
|
|
|
|
services.tlaternet-webserver.enable = true;
|
2021-04-12 01:44:10 +01:00
|
|
|
|
2022-10-12 19:58:09 +01:00
|
|
|
# Set up SSL
|
|
|
|
services.nginx.virtualHosts."${config.services.nginx.domain}" = let
|
|
|
|
inherit (config.services.tlaternet-webserver.listen) addr port;
|
|
|
|
in {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
extraConfig = ''
|
|
|
|
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
|
|
|
|
'';
|
2021-04-12 01:44:10 +01:00
|
|
|
|
2022-10-12 19:58:09 +01:00
|
|
|
locations."/".proxyPass = "http://${addr}:${toString port}";
|
2021-04-12 01:44:10 +01:00
|
|
|
};
|
|
|
|
}
|