fix: redirect root IP's in nginx to skynet.ie
This commit is contained in:
parent
39594e5973
commit
6b0507a647
8 changed files with 63 additions and 9 deletions
|
@ -47,13 +47,20 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
services.nginx.virtualHosts."${domain}" = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
"${domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "skynet";
|
useACMEHost = "skynet";
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
|
proxyPass = "http://127.0.0.1:${toString config.services.vaultwarden.config.ROCKET_PORT}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# has ADMIN_TOKEN and SMTP_PASSWORD
|
# has ADMIN_TOKEN and SMTP_PASSWORD
|
||||||
age.secrets.bitwarden_details.file = ../../secrets/bitwarden/details.age;
|
age.secrets.bitwarden_details.file = ../../secrets/bitwarden/details.age;
|
||||||
|
|
|
@ -245,6 +245,12 @@ in {
|
||||||
|
|
||||||
# to provide the certs
|
# to provide the certs
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
|
||||||
"mail.skynet.ie" = {
|
"mail.skynet.ie" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "mail";
|
useACMEHost = "mail";
|
||||||
|
|
|
@ -60,6 +60,12 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
|
||||||
"${cfg.domain.sub}.skynet.ie" = {
|
"${cfg.domain.sub}.skynet.ie" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "skynet";
|
useACMEHost = "skynet";
|
||||||
|
|
|
@ -108,6 +108,12 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
|
||||||
# https://config.minecraft.games.skynet.ie
|
# https://config.minecraft.games.skynet.ie
|
||||||
"config.${short_domain}" = {
|
"config.${short_domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
|
@ -150,6 +150,12 @@ in {
|
||||||
services.openssh.ports = [22 2222];
|
services.openssh.ports = [22 2222];
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
|
||||||
# main site
|
# main site
|
||||||
"${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}" = {
|
"${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
|
@ -108,6 +108,11 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
${domain} = {
|
${domain} = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "skynet";
|
useACMEHost = "skynet";
|
||||||
|
|
|
@ -68,6 +68,12 @@ in {
|
||||||
systemd.services.nginx.serviceConfig.ProtectHome = "read-only";
|
systemd.services.nginx.serviceConfig.ProtectHome = "read-only";
|
||||||
|
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
|
||||||
# main site
|
# main site
|
||||||
"*.users.skynet.ie" = {
|
"*.users.skynet.ie" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
|
@ -93,10 +93,22 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}" = {
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
group = "acme";
|
||||||
|
|
||||||
|
virtualHosts = {
|
||||||
|
"${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "skynet";
|
useACMEHost = "skynet";
|
||||||
locations."/".proxyPass = "http://localhost:8000";
|
locations."/".proxyPass = "http://localhost:8000";
|
||||||
};
|
};
|
||||||
|
"${cfg.host.ip}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "skynet";
|
||||||
|
locations."/".return = "307 https://skynet.ie";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue