2023-04-22 15:00:19 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
2023-08-01 18:06:40 +02:00
|
|
|
enableReload = true;
|
2023-04-22 15:00:19 +02:00
|
|
|
package = pkgs.nginxMainline;
|
2023-08-01 18:06:40 +02:00
|
|
|
recommendedBrotliSettings = true;
|
2023-04-22 15:00:19 +02:00
|
|
|
recommendedGzipSettings = true;
|
2023-08-01 18:06:40 +02:00
|
|
|
recommendedOptimisation = true;
|
2023-04-22 15:00:19 +02:00
|
|
|
recommendedProxySettings = true;
|
2023-08-01 18:06:40 +02:00
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedZstdSettings = true;
|
2023-04-22 15:00:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
users.users.nginx.extraGroups = [ "acme" ];
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
|
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
security.acme.defaults = {
|
|
|
|
dnsProvider = "hetzner";
|
|
|
|
dnsResolver = "hydrogen.ns.hetzner.com:53";
|
|
|
|
reloadServices = [ "nginx" ];
|
2023-10-11 00:14:42 +02:00
|
|
|
environmentFile = "/var/secrets/hetzner-acme";
|
2023-04-22 15:00:19 +02:00
|
|
|
};
|
2023-10-28 17:27:29 +02:00
|
|
|
|
|
|
|
systemd.services.nginx = {
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
wants = [ "network-online.target" ];
|
|
|
|
};
|
2023-04-22 15:00:19 +02:00
|
|
|
}
|