106 lines
2.8 KiB
Nix
106 lines
2.8 KiB
Nix
{ pkgs, ... }:
|
|
|
|
let
|
|
eh07 = pkgs.fetchgit {
|
|
url = "https://git.hamburg.ccc.de/CCCHH/easterhegg-2007-website.git";
|
|
rev = "0bb06fd2654814ddda28469a1bf9e50a9814dd9a";
|
|
hash = "sha256-jMpDxgxbL3ipG3HLJo0ISTdWfYYrd2EfwpmoiWV0qCM=";
|
|
};
|
|
in
|
|
{
|
|
security.acme.certs."eh07.easterhegg.eu".extraDomainNames = [
|
|
"eh2007.hamburg.ccc.de"
|
|
"www.eh2007.hamburg.ccc.de"
|
|
"eh07.hamburg.ccc.de"
|
|
"www.eh07.hamburg.ccc.de"
|
|
"easterhegg2007.hamburg.ccc.de"
|
|
"www.easterhegg2007.hamburg.ccc.de"
|
|
];
|
|
|
|
services.nginx.virtualHosts = {
|
|
"acme-eh07.easterhegg.eu" = {
|
|
enableACME = true;
|
|
serverName = "eh07.easterhegg.eu";
|
|
serverAliases = [
|
|
"eh2007.hamburg.ccc.de"
|
|
"www.eh2007.hamburg.ccc.de"
|
|
"eh07.hamburg.ccc.de"
|
|
"www.eh07.hamburg.ccc.de"
|
|
"easterhegg2007.hamburg.ccc.de"
|
|
"www.easterhegg2007.hamburg.ccc.de"
|
|
];
|
|
listen = [{
|
|
addr = "0.0.0.0";
|
|
port = 31820;
|
|
}];
|
|
};
|
|
|
|
"easterhegg2007.hamburg.ccc.de" = {
|
|
forceSSL = true;
|
|
useACMEHost = "eh07.easterhegg.eu";
|
|
serverAliases = [
|
|
"eh2007.hamburg.ccc.de"
|
|
"www.eh2007.hamburg.ccc.de"
|
|
"eh07.hamburg.ccc.de"
|
|
"www.eh07.hamburg.ccc.de"
|
|
"www.easterhegg2007.hamburg.ccc.de"
|
|
];
|
|
|
|
listen = [{
|
|
addr = "0.0.0.0";
|
|
port = 8443;
|
|
ssl = true;
|
|
proxyProtocol = true;
|
|
}];
|
|
|
|
locations."/".return = "302 https://eh07.easterhegg.eu";
|
|
|
|
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;
|
|
'';
|
|
};
|
|
|
|
"eh07.easterhegg.eu" = {
|
|
forceSSL = true;
|
|
useACMEHost = "eh07.easterhegg.eu";
|
|
|
|
listen = [{
|
|
addr = "0.0.0.0";
|
|
port = 8443;
|
|
ssl = true;
|
|
proxyProtocol = true;
|
|
}];
|
|
|
|
locations."/" = {
|
|
index = "index.shtml";
|
|
root = eh07;
|
|
extraConfig = ''
|
|
# Set default_type to html
|
|
default_type text/html;
|
|
# Enable SSI
|
|
ssi on;
|
|
'';
|
|
};
|
|
|
|
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;
|
|
# Enable SSI
|
|
ssi on;
|
|
'';
|
|
};
|
|
};
|
|
}
|