summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorEvan Danaher <edanaher@edanaher.net>2017-03-09 16:54:44 -0500
committerRobin Gloster <mail@glob.in>2017-03-21 17:55:27 +0100
commit84561b005c4dcd8cdb686916ef655c1b9254e1e6 (patch)
tree0e597bdccc5a869008825a75836f5b856a1d0793 /nixos
parent4bea988a7e05b9c1ad986e41de9f8c4a97a45dfb (diff)
nginx: disallow alias directive on server level; it doesn't work.
(cherry picked from commit a09246948cafb7672ea1e5590688e7eb6a16cef3)
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix7
-rw-r--r--nixos/modules/services/web-servers/nginx/vhost-options.nix9
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 8c08fcc946ecd..ae14aa28ae345 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -163,7 +163,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;
           ''}
@@ -405,10 +404,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 a76a971aff06b..c0ea645b3dfeb 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;