nginx module: add index and tryFiles
This commit is contained in:
parent
29649b93b8
commit
c011aa86ab
@ -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}
|
||||
}
|
||||
|
@ -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.
|
||||
'';
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user