tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
nginx module: add resolver config
Robin Gloster
8 years ago
94a2cba8
75bbcd42
+30
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
web-servers
nginx
default.nix
+30
nixos/modules/services/web-servers/nginx/default.nix
···
38
38
include ${cfg.package}/conf/fastcgi.conf;
39
39
include ${cfg.package}/conf/uwsgi_params;
40
40
41
41
+
${optionalString (cfg.resolver.addresses != []) ''
42
42
+
resolver ${toString cfg.resolver.addresses} ${optionalString (cfg.resolver.valid != "") "valid=${cfg.resolver.valid}"};
43
43
+
''}
44
44
+
41
45
${optionalString (cfg.recommendedOptimisation) ''
42
46
# optimisation
43
47
sendfile on;
···
383
387
default = null;
384
388
example = "/path/to/dhparams.pem";
385
389
description = "Path to DH parameters file.";
390
390
+
};
391
391
+
392
392
+
resolver = mkOption {
393
393
+
type = types.submodule {
394
394
+
options = {
395
395
+
addresses = mkOption {
396
396
+
type = types.listOf types.str;
397
397
+
default = [];
398
398
+
example = literalExample ''[ "[::1]" "127.0.0.1:5353" ]'';
399
399
+
description = "List of resolvers to use";
400
400
+
};
401
401
+
valid = mkOption {
402
402
+
type = types.str;
403
403
+
default = "";
404
404
+
example = "30s";
405
405
+
description = ''
406
406
+
By default, nginx caches answers using the TTL value of a response.
407
407
+
An optional valid parameter allows overriding it
408
408
+
'';
409
409
+
};
410
410
+
};
411
411
+
};
412
412
+
description = ''
413
413
+
Configures name servers used to resolve names of upstream servers into addresses
414
414
+
'';
415
415
+
default = {};
386
416
};
387
417
388
418
virtualHosts = mkOption {