mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-20 00:19:25 +03:00
nginx module: add proxyResolveWhileRunning option
This commit is contained in:
parent
4ffa9ddb30
commit
7cd46a0594
1 changed files with 17 additions and 1 deletions
|
@ -223,7 +223,13 @@ let
|
||||||
) virtualHosts);
|
) virtualHosts);
|
||||||
mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: ''
|
mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: ''
|
||||||
location ${location} {
|
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 ''
|
${optionalString config.proxyWebsockets ''
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
@ -426,6 +432,16 @@ in
|
||||||
description = "Path to DH parameters file.";
|
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 {
|
resolver = mkOption {
|
||||||
type = types.submodule {
|
type = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue