1
0
Fork 0
nixos-config/nixos/roles/mathechor.de.nix
Malte Brandy 082a2c069b
Put basicAuth secrets into nix-store
because everything else would be too much of a hazzle.
2020-10-04 16:24:18 +02:00

41 lines
1 KiB
Nix

{ config, pkgs, lib, ... }:
{
services = {
nginx = {
enable = true;
virtualHosts."mathechor.de" = {
serverAliases = [ "www.mathechor.de" ];
forceSSL = true;
enableACME = true;
locations = {
"/" = {
root = "/var/www/mathechor/public";
index = "index.html";
extraConfig =
"location ~* .(otf)$ {add_header Access-Control-Allow-Origin *;}";
};
};
};
virtualHosts."intern.mathechor.de" = {
forceSSL = true;
enableACME = true;
basicAuthFile = pkgs.privateFile "basic-auth/mathechor.de";
locations = {
"/" = {
root = "/var/www/mathechor/intern";
index = "index.html";
};
"/mathechor.ics" = {
proxyPass = pkgs.privateValue "" "mathechor-ics";
extraConfig = ''
proxy_ssl_name cloud.mathechor.de;
proxy_ssl_server_name on;
'';
};
};
};
};
};
}