nginx: Add alias configuration option for hosts and locations.
It's like root, but doesn't keep the prefix.
This commit is contained in:
parent
53a2baabbe
commit
ff2e2e82cc
@ -158,6 +158,7 @@ let
|
||||
server_name ${serverName} ${concatStringsSep " " vhost.serverAliases};
|
||||
${acmeLocation}
|
||||
${optionalString (vhost.root != null) "root ${vhost.root};"}
|
||||
${optionalString (vhost.alias != null) "alias ${vhost.alias};"}
|
||||
${optionalString (vhost.globalRedirect != null) ''
|
||||
return 301 http${optionalString ssl "s"}://${vhost.globalRedirect}$request_uri;
|
||||
''}
|
||||
@ -180,6 +181,7 @@ let
|
||||
${optionalString (config.index != null) "index ${config.index};"}
|
||||
${optionalString (config.tryFiles != null) "try_files ${config.tryFiles};"}
|
||||
${optionalString (config.root != null) "root ${config.root};"}
|
||||
${optionalString (config.alias != null) "alias ${config.alias};"}
|
||||
${config.extraConfig}
|
||||
}
|
||||
'') locations);
|
||||
|
@ -45,6 +45,15 @@ with lib;
|
||||
'';
|
||||
};
|
||||
|
||||
alias = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
example = "/your/alias/directory";
|
||||
description = ''
|
||||
Alias directory for requests.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
|
@ -89,6 +89,15 @@ with lib;
|
||||
'';
|
||||
};
|
||||
|
||||
alias = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
example = "/data/webserver/docs";
|
||||
description = ''
|
||||
The path of the web alias directory.
|
||||
'';
|
||||
};
|
||||
|
||||
default = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
Loading…
Reference in New Issue
Block a user