git.iko.soy/typeable/nixpkgs
on master help sign in
nginx module: add index and tryFiles
commitc011aa86ab62c90720304cb8218d4fa505cd8cf5 authorRobin Gloster <mail@glob.in> dateThu 25 Aug 2016, 23:24 (10 years ago) parent29649b9
2 files changed+21−2
nixos/modules/services/web-servers/nginx/default.nix+2 nixos/modules/services/web-servers/nginx/location-options.nix+19−2
nixos/modules/services/web-servers/nginx/default.nix+2
@@ -165,6 +165,8 @@ let
165165 mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: ''
166166 location ${location} {
167167 ${optionalString (config.proxyPass != null) "proxy_pass ${config.proxyPass};"}
168+ ${optionalString (config.index != null) "index ${config.index};"}
169+ ${optionalString (config.tryFiles != null) "try_files ${config.tryFiles};"}
168170 ${optionalString (config.root != null) "root ${config.root};"}
169171 ${config.extraConfig}
170172 }
nixos/modules/services/web-servers/nginx/location-options.nix+19−2
@@ -14,8 +14,25 @@ with lib;
1414 default = null;
1515 example = "http://www.example.org/";
1616 description = ''
17− Adds proxy_pass directive and sets default proxy headers Host, X-Real-Ip
18− and X-Forwarded-For.
17+ Adds proxy_pass directive.
18+ '';
19+ };
20+
21+ index = mkOption {
22+ type = types.nullOr types.str;
23+ default = null;
24+ example = "index.php index.html";
25+ description = ''
26+ Adds index directive.
27+ '';
28+ };
29+
30+ tryFiles = mkOption {
31+ type = types.nullOr types.str;
32+ default = null;
33+ example = "$uri =404";
34+ description = ''
35+ Adds try_files directive.
1936 '';
2037 };
2138