nix/modules/services/nginx/default.nix

58 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2024-11-16 20:08:49 +01:00
{
domain,
mail,
2024-11-24 20:15:38 +01:00
lib,
config,
2024-11-16 20:08:49 +01:00
...
}: {
2024-11-24 20:15:38 +01:00
options = {
nginx.enable = lib.mkEnableOption "";
};
config = lib.mkIf config.nginx.enable {
services.nginx = {
virtualHosts."xn--xck.xyz" = {
forceSSL = true;
enableACME = true;
root = "/var/www/www.${domain}";
};
virtualHosts."${domain}" = {
forceSSL = true;
enableACME = true;
root = "/var/www/www.${domain}";
};
virtualHosts."www.${domain}" = {
forceSSL = true;
enableACME = true;
root = "/var/www/www.${domain}";
};
virtualHosts."wallpapers.${domain}" = {
forceSSL = true;
enableACME = true;
root = "/var/www/wallpapers.${domain}";
};
virtualHosts."4get.${domain}" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:8080";
};
virtualHosts."pin.${domain}" = {
forceSSL = true;
enableACME = true;
2024-12-15 22:31:06 +01:00
locations."/".proxyPass = "http://localhost:8009";
2024-11-24 20:15:38 +01:00
};
virtualHosts."trans.${domain}" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:5000";
};
virtualHosts."yt.${domain}" = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://localhost:3000";
};
};
security.acme.defaults.email = "${mail}";
security.acme.acceptTerms = true;
2024-11-03 12:33:02 +01:00
};
}