nginx module: add index and tryFiles

This commit is contained in:
Robin Gloster 2016-08-25 23:24:10 +00:00
parent 29649b93b8
commit c011aa86ab
No known key found for this signature in database
GPG Key ID: 5E4C836C632C2882
2 changed files with 21 additions and 2 deletions

View File

@ -165,6 +165,8 @@ let
mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: ''
location ${location} {
${optionalString (config.proxyPass != null) "proxy_pass ${config.proxyPass};"}
${optionalString (config.index != null) "index ${config.index};"}
${optionalString (config.tryFiles != null) "try_files ${config.tryFiles};"}
${optionalString (config.root != null) "root ${config.root};"}
${config.extraConfig}
}

View File

@ -14,8 +14,25 @@ with lib;
default = null;
example = "http://www.example.org/";
description = ''
Adds proxy_pass directive and sets default proxy headers Host, X-Real-Ip
and X-Forwarded-For.
Adds proxy_pass directive.
'';
};
index = mkOption {
type = types.nullOr types.str;
default = null;
example = "index.php index.html";
description = ''
Adds index directive.
'';
};
tryFiles = mkOption {
type = types.nullOr types.str;
default = null;
example = "$uri =404";
description = ''
Adds try_files directive.
'';
};