nixos/spec/web/nginx.nix

28 lines
544 B
Nix
Raw Normal View History

2024-01-15 16:56:47 +08:00
{ pkgs
, ...}: {
services.nginx = {
enable = true;
# enable all recommended settings
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
virtualHosts = {
"_" = {
rejectSSL = true;
extraConfig = "return 444;";
};
"514fpv.one" = {
root = pkgs.callPackage ./site { };
forceSSL = true;
enableACME = true;
};
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
}