nginx module: add resolver config
This commit is contained in:
parent
75bbcd4215
commit
94a2cba8d9
1 changed files with 30 additions and 0 deletions
|
@ -38,6 +38,10 @@ let
|
|||
include ${cfg.package}/conf/fastcgi.conf;
|
||||
include ${cfg.package}/conf/uwsgi_params;
|
||||
|
||||
${optionalString (cfg.resolver.addresses != []) ''
|
||||
resolver ${toString cfg.resolver.addresses} ${optionalString (cfg.resolver.valid != "") "valid=${cfg.resolver.valid}"};
|
||||
''}
|
||||
|
||||
${optionalString (cfg.recommendedOptimisation) ''
|
||||
# optimisation
|
||||
sendfile on;
|
||||
|
@ -385,6 +389,32 @@ in
|
|||
description = "Path to DH parameters file.";
|
||||
};
|
||||
|
||||
resolver = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
addresses = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = literalExample ''[ "[::1]" "127.0.0.1:5353" ]'';
|
||||
description = "List of resolvers to use";
|
||||
};
|
||||
valid = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "30s";
|
||||
description = ''
|
||||
By default, nginx caches answers using the TTL value of a response.
|
||||
An optional valid parameter allows overriding it
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
description = ''
|
||||
Configures name servers used to resolve names of upstream servers into addresses
|
||||
'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
virtualHosts = mkOption {
|
||||
type = types.attrsOf (types.submodule (import ./vhost-options.nix {
|
||||
inherit config lib;
|
||||
|
|
Loading…
Reference in a new issue