2024-09-15 21:43:20 +02:00
|
|
|
{ materusArg, config, lib, pkgs, ... }:
|
2024-03-23 20:58:26 +01:00
|
|
|
{
|
|
|
|
options.waffentragerService.nginx.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable nginx";
|
|
|
|
|
|
|
|
|
|
|
|
config =
|
|
|
|
let
|
|
|
|
cfg = config.waffentragerService.nginx;
|
|
|
|
in
|
|
|
|
lib.mkIf cfg.enable {
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedGzipSettings = true;
|
2024-09-15 21:43:20 +02:00
|
|
|
package = pkgs.tengine;
|
|
|
|
virtualHosts."default" = {
|
|
|
|
sslTrustedCertificate = "/var/lib/mnt_acme/materus.pl/chain.pem";
|
|
|
|
sslCertificateKey = "/var/lib/mnt_acme/materus.pl/key.pem";
|
|
|
|
sslCertificate = "/var/lib/mnt_acme/materus.pl/fullchain.pem";
|
|
|
|
forceSSL = true;
|
|
|
|
http2 = false;
|
|
|
|
default = true;
|
|
|
|
locations."/" = { extraConfig = ''deny all;''; };
|
|
|
|
};
|
2024-03-23 20:58:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.nginx = {
|
|
|
|
requires = [ "var-lib-mnt_acme.mount" ];
|
|
|
|
after = [ "var-lib-mnt_acme.mount" ];
|
2024-04-11 18:43:38 +02:00
|
|
|
serviceConfig = {
|
|
|
|
restart = "always";
|
|
|
|
restartSec = 60;
|
|
|
|
};
|
2024-03-23 20:58:26 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|