nginx: utilisation fonctions

This commit is contained in:
nyanloutre 2020-04-09 16:28:25 +02:00
parent 3c6677354a
commit dfa4431c47
1 changed files with 27 additions and 91 deletions

View File

@ -133,110 +133,45 @@ in
''; '';
}; };
in { in {
"nyanlout.re" = { "nyanlout.re" = base {
default = true; "/" = {
enableACME = true; alias = "/var/www/site-perso/";
forceSSL = true;
locations = {
"/" = {
alias = "/var/www/site-perso/";
};
"/errorpages/" = {
alias = "/var/www/errorpages/";
};
"/.well-known/openpgpkey/" = {
alias = "/var/lib/gnupg/wks/nyanlout.re";
extraConfig = ''
add_header Access-Control-Allow-Origin * always;
'';
};
}; };
}; "/errorpages/" = {
"riot.nyanlout.re" = { alias = "/var/www/errorpages/";
enableACME = true;
forceSSL = true;
locations = { "/" = { root = pkgs.riot-web; }; };
};
"factorio.nyanlout.re" = {
enableACME = true;
forceSSL = true;
locations = { "/" = { root = "/var/www/factorio"; }; };
};
"minecraft.nyanlout.re" = {
enableACME = true;
forceSSL = true;
locations = { "/" = { root = "/var/www/minecraft-overviewer"; }; };
};
"musique-meyenheim.fr" = {
enableACME = true;
forceSSL = true;
locations = {
"/" = {
proxyPass = "http://unix:/run/site-musique.sock";
};
"/static/" = {
alias = "/var/www/site-musique/staticfiles/";
};
"/media/" = {
alias = "/var/www/site-musique/media/";
};
}; };
}; "/.well-known/openpgpkey/" = {
"maxspiegel.fr" = { alias = "/var/lib/gnupg/wks/nyanlout.re";
enableACME = true;
forceSSL = true;
locations."/" = {
root = "/run/python-ci/nyanloutre/site-max";
};
};
"social.nyanlout.re" = {
enableACME = true;
forceSSL = true;
root = "${config.services.mastodon.package}/public/";
locations."/system/".alias = "/var/lib/mastodon/public-system/";
locations."/" = {
tryFiles = "$uri @proxy";
};
locations."@proxy" = {
proxyPass = "http://127.0.0.1:${toString(config.services.mastodon.webPort)}";
proxyWebsockets = true;
extraConfig = '' extraConfig = ''
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; add_header Access-Control-Allow-Origin * always;
''; '';
}; };
} // { default = true; };
locations."/api/v1/streaming/" = { "riot.nyanlout.re" = base { "/" = { root = pkgs.riot-web; }; };
proxyPass = "http://127.0.0.1:${toString(config.services.mastodon.streamingPort)}/"; "factorio.nyanlout.re" = base { "/" = { root = "/var/www/factorio"; }; };
proxyWebsockets = true; "minecraft.nyanlout.re" = base { "/" = { root = "/var/www/minecraft-overviewer"; }; };
extraConfig = '' "musique-meyenheim.fr" = base {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto; "/" = {
''; proxyPass = "http://unix:/run/site-musique.sock";
};
"/static/" = {
alias = "/var/www/site-musique/staticfiles/";
};
"/media/" = {
alias = "/var/www/site-musique/media/";
}; };
}; };
"stream.nyanlout.re" = { "maxspiegel.fr" = base { "/" = { root = "/run/python-ci/nyanloutre/site-max"; };
enableACME = true; "stream.nyanlout.re" = base {
forceSSL = true; "/" = {
root = "/var/www/hls/"; root = "/var/www/hls/"
locations."/" = {
extraConfig = '' extraConfig = ''
add_header Cache-Control no-cache; add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
''; '';
}; };
}; };
"login.nyanlout.re" = { "login.nyanlout.re" = simpleReverse config.services.nginx.sso.configuration.listen.port;
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString(config.services.nginx.sso.configuration.listen.port)}/";
};
};
"grafana.nyanlout.re" = authReverse config.services.grafana.port; "grafana.nyanlout.re" = authReverse config.services.grafana.port;
"transmission.nyanlout.re" = authReverse config.services.transmission.port; "transmission.nyanlout.re" = authReverse config.services.transmission.port;
"radarr.nyanlout.re" = authReverse 7878; "radarr.nyanlout.re" = authReverse 7878;
@ -321,6 +256,7 @@ in
mastodon = { mastodon = {
enable = true; enable = true;
localDomain = "social.nyanlout.re"; localDomain = "social.nyanlout.re";
configureNginx = true;
extraConfig = { extraConfig = {
SMTP_AUTH_METHOD = "none"; SMTP_AUTH_METHOD = "none";
SMTP_OPENSSL_VERIFY_MODE = "none"; SMTP_OPENSSL_VERIFY_MODE = "none";