Configuration de anubis

merge-requests/18/head
korenstin 2025-06-15 10:19:37 +02:00
parent cae379f473
commit 6e9de7cab7
3 changed files with 68 additions and 23 deletions

View File

@ -4,9 +4,11 @@
imports = [
./hardware-configuration.nix
./networking.nix
./reverseproxy.nix
../../../modules
../../../modules/services/acme.nix
../../../modules/services/anubis.nix
../../../modules/services/nginx.nix
];
@ -14,27 +16,4 @@
boot.loader.grub.devices = [ "/dev/sda" ];
system.stateVersion = "25.05";
users.users."nginx".home = "/var/lib/nginx";
services.nginx.virtualHosts = {
"install-party.crans.org" = {
enableACME = true;
forceSSL = true;
serverAliases = [
"i-p.crans.org"
"adopteunmanchot.crans.org"
"adopteunpingouin.crans.org"
"i-p.crans.fr"
"install-party.crans.fr"
"adopteunmanchot.crans.fr"
"adopteunpingouin.crans.fr"
"i-p.crans.eu"
"install-party.crans.eu"
"adopteunmanchot.crans.eu"
"adopteunpingouin.crans.eu"
];
root = "/var/www/install-party.crans.org";
};
};
}

View File

@ -0,0 +1,50 @@
{ ... }:
{
users.users."nginx".home = "/var/lib/nginx";
services.nginx.virtualHosts = {
# redirection install-party
"install-party.crans.fr" = {
enableACME = true;
forceSSL = true;
serverAliases = [
"i-p.crans.org"
"adopteunmanchot.crans.org"
"adopteunpingouin.crans.org"
"i-p.crans.fr"
"install-party.crans.fr"
"adopteunmanchot.crans.fr"
"adopteunpingouin.crans.fr"
"i-p.crans.eu"
"install-party.crans.eu"
"adopteunmanchot.crans.eu"
"adopteunpingouin.crans.eu"
];
extraConfig = ''
return 301 https://install-party.crans.org$request_uri;
'';
};
# redirection anubis
"anubis" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:7777";
};
serverName = "install-party.crans.org";
};
# page install-party
"install-party.crans.org" = {
root = "/var/www/install-party.crans.org";
listen = [
{
addr = "localhost";
port = 8888;
}
];
};
};
}

View File

@ -0,0 +1,16 @@
{ ... }:
{
services.anubis = {
instances."muraille" = {
enable = true;
settings = {
BIND_NETWORK = "tcp";
BIND = "127.0.0.1:7777";
TARGET = "http://localhost:8888";
COOKIE_DOMAIN = "crans.org";
REDIRECT_DOMAINS = "install-party.crans.org";
};
};
};
}