1
0
Fork 1
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:
Robin Gloster 2017-04-15 23:21:44 +02:00
parent 4ffa9ddb30
commit 7cd46a0594
No known key found for this signature in database
GPG key ID: D5C458DF6DD97EDF

View file

@ -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 = {