nixos/services: add nginx base configuration

This commit is contained in:
2026-05-02 23:37:28 +02:00
committed by ErrorNoInternet
parent b6e8297085
commit 7ff5fb0da2
2 changed files with 38 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
{ config, lib, ... }:
let
inherit (config.networking) fqdn;
mkVhost =
attrs:
{
forceSSL = false; # TODO: tweak per host
}
// attrs;
mkProxy = port: {
proxyPass = "http://127.0.0.1:${toString port}/";
};
in
{
networking.firewall.allowedTCPPorts = [
80
443
];
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
# services.nginx.virtualHosts."${fqdn}" = {
# addSSL = true;
# root = "/var/www/myhost.org";
# default = true;
# };
};
}