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,11 +133,7 @@ in
''; '';
}; };
in { in {
"nyanlout.re" = { "nyanlout.re" = base {
default = true;
enableACME = true;
forceSSL = true;
locations = {
"/" = { "/" = {
alias = "/var/www/site-perso/"; alias = "/var/www/site-perso/";
}; };
@ -150,27 +146,11 @@ in
add_header Access-Control-Allow-Origin * always; add_header Access-Control-Allow-Origin * always;
''; '';
}; };
}; } // { default = true; };
}; "riot.nyanlout.re" = base { "/" = { root = pkgs.riot-web; }; };
"riot.nyanlout.re" = { "factorio.nyanlout.re" = base { "/" = { root = "/var/www/factorio"; }; };
enableACME = true; "minecraft.nyanlout.re" = base { "/" = { root = "/var/www/minecraft-overviewer"; }; };
forceSSL = true; "musique-meyenheim.fr" = base {
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"; proxyPass = "http://unix:/run/site-musique.sock";
}; };
@ -181,62 +161,17 @@ in
alias = "/var/www/site-musique/media/"; alias = "/var/www/site-musique/media/";
}; };
}; };
}; "maxspiegel.fr" = base { "/" = { root = "/run/python-ci/nyanloutre/site-max"; };
"maxspiegel.fr" = { "stream.nyanlout.re" = base {
enableACME = true; "/" = {
forceSSL = true; root = "/var/www/hls/"
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 = ''
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
'';
};
locations."/api/v1/streaming/" = {
proxyPass = "http://127.0.0.1:${toString(config.services.mastodon.streamingPort)}/";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
'';
};
};
"stream.nyanlout.re" = {
enableACME = true;
forceSSL = true;
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";