mirror of https://gitlab.crans.org/nounous/nixos
configuration post-factorisation
parent
549dc069f6
commit
5d99a7fea1
|
@ -2,18 +2,35 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./anubis.nix
|
||||
./hardware-configuration.nix
|
||||
./networking.nix
|
||||
./reverseproxy.nix
|
||||
|
||||
../../../modules
|
||||
../../../modules/services/acme.nix
|
||||
../../../modules/services/anubis.nix
|
||||
../../../modules/services/nginx.nix
|
||||
];
|
||||
|
||||
networking.hostName = "reverseproxy";
|
||||
boot.loader.grub.devices = [ "/dev/sda" ];
|
||||
|
||||
crans = {
|
||||
enable = true;
|
||||
|
||||
networking = {
|
||||
id = "51";
|
||||
srvNat.enable = true;
|
||||
srv = {
|
||||
enable = true;
|
||||
interface = "ens20";
|
||||
ipv4 = "185.230.79.42";
|
||||
};
|
||||
};
|
||||
|
||||
resticClient.when = "03:42";
|
||||
|
||||
services = {
|
||||
acme.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
|
|
|
@ -3,95 +3,98 @@
|
|||
{
|
||||
users.users."nginx".home = "/var/lib/nginx";
|
||||
|
||||
services.nginx.virtualHosts =
|
||||
let anubisConf = [
|
||||
{
|
||||
addr = "localhost";
|
||||
port = 8888;
|
||||
}
|
||||
];
|
||||
in {
|
||||
# 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"
|
||||
"adopteunmanchot.crans.fr"
|
||||
"adopteunpingouin.crans.fr"
|
||||
"i-p.crans.eu"
|
||||
"install-party.crans.eu"
|
||||
"adopteunmanchot.crans.eu"
|
||||
"adopteunpingouin.crans.eu"
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts =
|
||||
let anubisConf = [
|
||||
{
|
||||
addr = "localhost";
|
||||
port = 8888;
|
||||
}
|
||||
];
|
||||
extraConfig = ''
|
||||
return 301 https://install-party.crans.org$request_uri;
|
||||
'';
|
||||
};
|
||||
|
||||
# redirection mediawiki
|
||||
"mediawiki.crans.fr" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
serverAliases = [
|
||||
"mediakiwi.crans.org"
|
||||
"mediakiwi.crans.fr"
|
||||
"mediakiwi.crans.eu"
|
||||
"mediawiki.crans.eu"
|
||||
];
|
||||
extraConfig = ''
|
||||
return 301 https://mediawiki.crans.org$request_uri;
|
||||
'';
|
||||
};
|
||||
|
||||
# redirection wiki
|
||||
"wiki.crans.fr" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
serverAliases = [
|
||||
"wikipedia.crans.org"
|
||||
"wikipedia.crans.fr"
|
||||
"wikipedia.crans.eu"
|
||||
"wiki.crans.eu"
|
||||
];
|
||||
extraConfig = ''
|
||||
return 301 https://wiki.crans.org$request_uri;
|
||||
'';
|
||||
};
|
||||
|
||||
# redirection anubis
|
||||
"anubis" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${config.services.anubis.instances."muraille".settings.BIND}";
|
||||
in {
|
||||
# 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"
|
||||
"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;
|
||||
'';
|
||||
};
|
||||
serverName = "install-party.crans.org";
|
||||
serverAliases = [
|
||||
"mediawiki.crans.org"
|
||||
"wiki.crans.org"
|
||||
];
|
||||
};
|
||||
|
||||
# install-party
|
||||
"install-party.crans.org" = {
|
||||
root = "/var/www/install-party.crans.org";
|
||||
listen = anubisConf;
|
||||
};
|
||||
# redirection mediawiki
|
||||
"mediawiki.crans.fr" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
serverAliases = [
|
||||
"mediakiwi.crans.org"
|
||||
"mediakiwi.crans.fr"
|
||||
"mediakiwi.crans.eu"
|
||||
"mediawiki.crans.eu"
|
||||
];
|
||||
extraConfig = ''
|
||||
return 301 https://mediawiki.crans.org$request_uri;
|
||||
'';
|
||||
};
|
||||
|
||||
# mediawiki
|
||||
"mediawiki.crans.org" = {
|
||||
locations."/".proxyPass = "http://172.16.10.144";
|
||||
listen = anubisConf;
|
||||
};
|
||||
# redirection wiki
|
||||
"wiki.crans.fr" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
serverAliases = [
|
||||
"wikipedia.crans.org"
|
||||
"wikipedia.crans.fr"
|
||||
"wikipedia.crans.eu"
|
||||
"wiki.crans.eu"
|
||||
];
|
||||
extraConfig = ''
|
||||
return 301 https://wiki.crans.org$request_uri;
|
||||
'';
|
||||
};
|
||||
|
||||
# wiki
|
||||
"wiki.crans.org" = {
|
||||
locations."/".proxyPass = "http://172.16.10.161";
|
||||
listen = anubisConf;
|
||||
# redirection anubis
|
||||
"anubis" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${config.services.anubis.instances."muraille".settings.BIND}";
|
||||
};
|
||||
serverName = "install-party.crans.org";
|
||||
serverAliases = [
|
||||
"mediawiki.crans.org"
|
||||
"wiki.crans.org"
|
||||
];
|
||||
};
|
||||
|
||||
# install-party
|
||||
"install-party.crans.org" = {
|
||||
root = "/var/www/install-party.crans.org";
|
||||
listen = anubisConf;
|
||||
};
|
||||
|
||||
# mediawiki
|
||||
"mediawiki.crans.org" = {
|
||||
locations."/".proxyPass = "http://172.16.10.144";
|
||||
listen = anubisConf;
|
||||
};
|
||||
|
||||
# wiki
|
||||
"wiki.crans.org" = {
|
||||
locations."/".proxyPass = "http://172.16.10.161";
|
||||
listen = anubisConf;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue