nixos/nginx: add extraConfigPre option for locations

This commit is contained in:
2026-01-06 09:45:45 +08:00
parent d7f3d87456
commit d8ca282fc0
2 changed files with 9 additions and 0 deletions

View File

@@ -528,6 +528,7 @@ let
concatStringsSep "\n" (
map (config: ''
location ${config.location} {
${config.extraConfigPre}
${optionalString (
config.proxyPass != null && !cfg.proxyResolveWhileRunning
) "proxy_pass ${config.proxyPass};"}

View File

@@ -131,6 +131,14 @@ with lib;
'';
};
extraConfigPre = mkOption {
type = types.lines;
default = "";
description = ''
These lines go to the beginning of the location verbatim.
'';
};
priority = mkOption {
type = types.int;
default = 1000;