mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 21:50:55 +00:00
nginx module: add proxyResolveWhileRunning option
This commit is contained in:
parent
4ffa9ddb30
commit
7cd46a0594
|
@ -223,7 +223,13 @@ let
|
|||
) virtualHosts);
|
||||
mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: ''
|
||||
location ${location} {
|
||||
${optionalString (config.proxyPass != null) "proxy_pass ${config.proxyPass};"}
|
||||
${optionalString (config.proxyPass != null && !cfg.proxyResolveWhileRunning)
|
||||
"proxy_pass ${config.proxyPass};"
|
||||
}
|
||||
${optionalString (config.proxyPass != null && cfg.proxyResolveWhileRunning) ''
|
||||
set $nix_proxy_target "${config.proxyPass}";
|
||||
proxy_pass $nix_proxy_target;
|
||||
''}
|
||||
${optionalString config.proxyWebsockets ''
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
|
@ -426,6 +432,16 @@ in
|
|||
description = "Path to DH parameters file.";
|
||||
};
|
||||
|
||||
proxyResolveWhileRunning = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Resolves domains of proxyPass targets at runtime
|
||||
and not only at start, you have to set
|
||||
services.nginx.resolver, too.
|
||||
'';
|
||||
};
|
||||
|
||||
resolver = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
|
|
Loading…
Reference in a new issue