nixos/nginx: allow recommended proxy settings to be enabled per location
This commit is contained in:
parent
e3aa43fd23
commit
6c53004840
|
@ -360,7 +360,7 @@ let
|
||||||
${optionalString (config.alias != null) "alias ${config.alias};"}
|
${optionalString (config.alias != null) "alias ${config.alias};"}
|
||||||
${optionalString (config.return != null) "return ${config.return};"}
|
${optionalString (config.return != null) "return ${config.return};"}
|
||||||
${config.extraConfig}
|
${config.extraConfig}
|
||||||
${optionalString (config.proxyPass != null && cfg.recommendedProxySettings) "include ${recommendedProxyConfig};"}
|
${optionalString (config.proxyPass != null && config.recommendedProxySettings) "include ${recommendedProxyConfig};"}
|
||||||
${mkBasicAuth "sublocation" config}
|
${mkBasicAuth "sublocation" config}
|
||||||
}
|
}
|
||||||
'') (sortProperties (mapAttrsToList (k: v: v // { location = k; }) locations)));
|
'') (sortProperties (mapAttrsToList (k: v: v // { location = k; }) locations)));
|
||||||
|
@ -423,7 +423,7 @@ in
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = "
|
description = "
|
||||||
Enable recommended proxy settings.
|
Whether to enable recommended proxy settings if a vhost does not specify the option manually.
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# has additional options that affect the web server as a whole, like
|
# has additional options that affect the web server as a whole, like
|
||||||
# the user/group to run under.)
|
# the user/group to run under.)
|
||||||
|
|
||||||
{ lib }:
|
{ lib, config }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -128,5 +128,14 @@ with lib;
|
||||||
a greater priority.
|
a greater priority.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
recommendedProxySettings = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = config.services.nginx.recommendedProxySettings;
|
||||||
|
defaultText = literalExpression "config.services.nginx.recommendedProxySettings";
|
||||||
|
description = ''
|
||||||
|
Enable recommended proxy settings.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,7 +281,7 @@ with lib;
|
||||||
|
|
||||||
locations = mkOption {
|
locations = mkOption {
|
||||||
type = types.attrsOf (types.submodule (import ./location-options.nix {
|
type = types.attrsOf (types.submodule (import ./location-options.nix {
|
||||||
inherit lib;
|
inherit lib config;
|
||||||
}));
|
}));
|
||||||
default = {};
|
default = {};
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
|
|
Loading…
Reference in a new issue