57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
|
{ pkgs, ... }:
|
||
|
|
||
|
let
|
||
|
eh09 = builtins.fetchGit {
|
||
|
url = "forgejo@git.hamburg.ccc.de:CCCHH/easterhegg-2009-website.git";
|
||
|
ref = "main";
|
||
|
rev = "30498f6b2cba4f2c37db810f1bc2b98638ac9f05";
|
||
|
};
|
||
|
in
|
||
|
{
|
||
|
services.nginx.virtualHosts = {
|
||
|
"acme-eh09.easterhegg.eu" = {
|
||
|
enableACME = true;
|
||
|
serverName = "eh09.easterhegg.eu";
|
||
|
|
||
|
listen = [
|
||
|
{
|
||
|
addr = "0.0.0.0";
|
||
|
port = 31820;
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
|
||
|
"eh09.easterhegg.eu" = {
|
||
|
forceSSL = true;
|
||
|
useACMEHost = "eh09.easterhegg.eu";
|
||
|
|
||
|
listen = [
|
||
|
{
|
||
|
addr = "0.0.0.0";
|
||
|
port = 8443;
|
||
|
ssl = true;
|
||
|
proxyProtocol = true;
|
||
|
}
|
||
|
];
|
||
|
|
||
|
root = pkgs.buildEnv {
|
||
|
name = "eh09";
|
||
|
paths = [
|
||
|
eh09
|
||
|
];
|
||
|
};
|
||
|
|
||
|
extraConfig = ''
|
||
|
# Make use of the ngx_http_realip_module to set the $remote_addr and
|
||
|
# $remote_port to the client address and client port, when using proxy
|
||
|
# protocol.
|
||
|
# First set our proxy protocol proxy as trusted.
|
||
|
set_real_ip_from 172.31.17.140;
|
||
|
# Then tell the realip_module to get the addreses from the proxy protocol
|
||
|
# header.
|
||
|
real_ip_header proxy_protocol;
|
||
|
'';
|
||
|
};
|
||
|
};
|
||
|
}
|