feat(web): add nginx configuration

This commit is contained in:
514fpv 2024-01-15 16:56:47 +08:00
parent 999db46720
commit 164a57da25
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw

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 ];
}