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: ''
|
mkLocations = locations: concatStringsSep "\n" (mapAttrsToList (location: config: ''
|
||||||
location ${location} {
|
location ${location} {
|
||||||
${optionalString (config.proxyPass != null) "proxy_pass ${config.proxyPass};"}
|
${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};"}
|
${optionalString (config.root != null) "root ${config.root};"}
|
||||||
${config.extraConfig}
|
${config.extraConfig}
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,25 @@ with lib;
|
|||||||
default = null;
|
default = null;
|
||||||
example = "http://www.example.org/";
|
example = "http://www.example.org/";
|
||||||
description = ''
|
description = ''
|
||||||
Adds proxy_pass directive and sets default proxy headers Host, X-Real-Ip
|
Adds proxy_pass directive.
|
||||||
and X-Forwarded-For.
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
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…
x
Reference in New Issue
Block a user