public-web-static: setup cpu.ccc.de with redirects from aliases
This commit is contained in:
parent
709afd0a1d
commit
193ccedbee
1 changed files with 37 additions and 4 deletions
|
|
@ -1,13 +1,17 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
# For now under cpuccc.hamburg.ccc.de.
|
domain = "cpu.ccc.de";
|
||||||
domain = "cpuccc.hamburg.ccc.de";
|
dataDir = "/var/www/${domain}";
|
||||||
# dataDir = "/var/www/${domain}";
|
|
||||||
dataDir = "/var/www/cpu.ccc.de";
|
|
||||||
deployUser = "cpuccc-website-deploy";
|
deployUser = "cpuccc-website-deploy";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
security.acme.certs."cpu.ccc.de".extraDomainNames = [
|
||||||
|
"cpuccc.hamburg.ccc.de"
|
||||||
|
"lokal.ccc.de"
|
||||||
|
"local.ccc.de"
|
||||||
|
];
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
"acme-${domain}" = {
|
"acme-${domain}" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
@ -70,6 +74,35 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"cpuccc.hamburg.ccc.de" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "cpu.ccc.de";
|
||||||
|
serverAliases = [
|
||||||
|
"lokal.ccc.de"
|
||||||
|
"local.ccc.de"
|
||||||
|
];
|
||||||
|
|
||||||
|
listen = [{
|
||||||
|
addr = "0.0.0.0";
|
||||||
|
port = 8443;
|
||||||
|
ssl = true;
|
||||||
|
proxyProtocol = true;
|
||||||
|
}];
|
||||||
|
|
||||||
|
locations."/".return = "302 https://cpu.ccc.de";
|
||||||
|
|
||||||
|
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;
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue