Compare commits

...
Sign in to create a new pull request.

1 commit
main ... nginx

Author SHA1 Message Date
cy
176726501a init nginx 2025-01-17 16:19:10 -05:00
2 changed files with 29 additions and 0 deletions

View file

@ -2,5 +2,6 @@
{ {
imports = [ imports = [
./backup.nix ./backup.nix
./nginx.nix
]; ];
} }

28
modules/nginx.nix Normal file
View file

@ -0,0 +1,28 @@
{ config, lib, ...}:
let
cfg = config.my.nginx;
in
{
options.my.nginx = {
enable = lib.mkEnableOption "nginx";
};
config = lib.mkIf cfg.enable {
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedZstdSettings = true;
recommendedProxySettings = true;
# HSTS for all domains
appendHttpConfig = ''
map $scheme $hsts_header {
https "max-age=31536000; includeSubdomains; preload";
}
add_header Strict-Transport-Security $hsts_header;
'';
};
};
}