tlaternet-server/configuration/services/webserver.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
547 B
Nix
Raw Normal View History

{ config, ... }:
let
domain = config.services.nginx.domain;
in
{
services.tlaternet-webserver = {
enable = true;
listen = {
addr = "127.0.0.1";
port = 8000;
2021-12-26 19:00:59 +00:00
};
};
# Set up SSL
services.nginx.virtualHosts."${domain}" =
let
inherit (config.services.tlaternet-webserver.listen) addr port;
in
{
serverAliases = [ "www.${domain}" ];
2021-04-12 01:44:10 +01:00
forceSSL = true;
2024-04-16 00:08:13 +01:00
useACMEHost = "tlater.net";
2024-04-13 03:34:53 +01:00
enableHSTS = true;
2021-04-12 01:44:10 +01:00
locations."/".proxyPass = "http://${addr}:${toString port}";
2021-04-12 01:44:10 +01:00
};
}