spec(web): add nginx configuration

This commit is contained in:
514fpv 2024-01-15 16:56:47 +08:00
parent 2f07609f4b
commit d80069df71
Signed by: koishi
SSH key fingerprint: SHA256:2jRvFSzG5UeUlQ3WxZ2sbUOfo5wNKzv1fZsk/FexKjQ

27
spec/web/nginx.nix Normal file
View file

@ -0,0 +1,27 @@
{ 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 ];
}