2022-12-27 12:53:15 +01:00
|
|
|
{ config, depot, ... }:
|
2022-12-24 23:58:21 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./base.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
config = {
|
|
|
|
services.nginx.virtualHosts."inbox.tvl.su" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
|
|
|
|
extraConfig = ''
|
2022-12-27 12:53:15 +01:00
|
|
|
# nginx is incapable of serving a single file at /, hence this hack:
|
2022-12-24 23:58:21 +01:00
|
|
|
location = / {
|
2022-12-27 12:53:15 +01:00
|
|
|
index /landing-page;
|
2022-12-24 23:58:21 +01:00
|
|
|
}
|
|
|
|
|
2022-12-27 12:53:15 +01:00
|
|
|
location = /landing-page {
|
|
|
|
types { } default_type "text/html; charset=utf-8";
|
|
|
|
alias ${depot.web.inbox};
|
|
|
|
}
|
|
|
|
|
|
|
|
# rest of requests is proxied to public-inbox-httpd
|
2022-12-24 23:58:21 +01:00
|
|
|
location / {
|
|
|
|
proxy_pass http://localhost:${toString config.services.public-inbox.http.port};
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|