nixos/services: add nginx base configuration

This commit is contained in:
2026-05-02 23:37:28 +02:00
parent 6ce06f0f84
commit e8cfe4c750
3 changed files with 35 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
{ config, lib, ... }:
let
fqdn = config.networking.fqdn;
mkVhost =
attrs:
{
forceSSL = false; # TODO: tweak per host
}
// attrs;
mkProxy = port: {
proxyPass = "http://127.0.0.1:${toString port}/";
};
in
{
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;
# };
};
}