| 1 | { |
| 2 | networking.firewall = { |
| 3 | allowedTCPPorts = [ |
| 4 | 80 |
| 5 | 443 |
| 6 | ]; |
| 7 | }; |
| 8 | |
| 9 | # Grant nginx access to certificates |
| 10 | systemd.services.nginx.serviceConfig.SupplementaryGroups = [ "acme" ]; |
| 11 | |
| 12 | # Reload nginx after certificate renewal |
| 13 | security.acme.defaults.reloadServices = [ "nginx.service" ]; |
| 14 | |
| 15 | services.nginx = { |
| 16 | enable = true; |
| 17 | enableReload = true; |
| 18 | |
| 19 | recommendedBrotliSettings = true; |
| 20 | recommendedGzipSettings = true; |
| 21 | recommendedOptimisation = true; |
| 22 | recommendedProxySettings = true; |
| 23 | recommendedTlsSettings = true; |
| 24 | }; |
| 25 | } |