diff options
Diffstat (limited to 'os/srv/nginx.nix')
| -rw-r--r-- | os/srv/nginx.nix | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/os/srv/nginx.nix b/os/srv/nginx.nix index b0c01a7..f0207b3 100644 --- a/os/srv/nginx.nix +++ b/os/srv/nginx.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: let cfg = config.os.srv.nginx; @@ -17,14 +22,30 @@ in config = lib.mkIf cfg.enable { services.nginx = { enable = true; + package = pkgs.nginx.override { openssl = pkgs.libressl; }; recommendedProxySettings = true; recommendedTlsSettings = true; recommendedOptimisation = true; recommendedGzipSettings = true; + virtualHosts = { + default = { + serverName = "_"; + default = true; + rejectSSL = true; + locations."/".return = "444"; + }; + }; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "adikro@disroot.org"; }; - networking.firewall.allowedTCPPorts = lib.mkOptional cfg.openFirewall [ + # users.users.nginx.extraGroups = [ "acme" ]; + + networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewall [ 80 443 ]; |
