diff options
author | Evan Danaher <edanaher@edanaher.net> | 2017-03-09 16:54:44 -0500 |
---|---|---|
committer | Evan Danaher <edanaher@edanaher.net> | 2017-03-09 16:54:44 -0500 |
commit | a09246948cafb7672ea1e5590688e7eb6a16cef3 (patch) | |
tree | b3bd7621de30cdf2e93e8c2ae58b24c522e9ef9e /nixos/modules/services | |
parent | e7358b192a3cdfc7d64fa2a21321df03b2256345 (diff) | |
download | nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.tar nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.tar.gz nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.tar.bz2 nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.tar.lz nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.tar.xz nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.tar.zst nixlib-a09246948cafb7672ea1e5590688e7eb6a16cef3.zip |
nginx: disallow alias directive on server level; it doesn't work.
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/web-servers/nginx/default.nix | 7 | ||||
-rw-r--r-- | nixos/modules/services/web-servers/nginx/vhost-options.nix | 9 |
2 files changed, 2 insertions, 14 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index 72cc10caef11..709fce522d52 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -158,7 +158,6 @@ 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; ''} @@ -380,10 +379,8 @@ in config = mkIf cfg.enable { # TODO: test user supplied config file pases syntax test - assertions = let hostOrAliasIsNull = l: l.root == null || l.alias == null; in [ { - assertion = all hostOrAliasIsNull (attrValues virtualHosts); - message = "Only one of nginx root or alias can be specified on a virtualHost."; - } { + assertions = let hostOrAliasIsNull = l: l.root == null || l.alias == null; in [ + { assertion = all (host: all hostOrAliasIsNull (attrValues host.locations)) (attrValues virtualHosts); message = "Only one of nginx root or alias can be specified on a location."; } diff --git a/nixos/modules/services/web-servers/nginx/vhost-options.nix b/nixos/modules/services/web-servers/nginx/vhost-options.nix index a76a971aff06..c0ea645b3dfe 100644 --- a/nixos/modules/services/web-servers/nginx/vhost-options.nix +++ b/nixos/modules/services/web-servers/nginx/vhost-options.nix @@ -89,15 +89,6 @@ 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; |