summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/apache-httpd/vhost-options.nix
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2021-08-14 08:35:30 -0400
committerAaron Andersen <aaron@fosslib.net>2021-08-20 10:29:16 -0400
commit98e354074fdd30c23b8d64f5bc963d6a2c87a231 (patch)
treef3e5db1ac0f97d794130096b4076427cc3ba3fd7 /nixos/modules/services/web-servers/apache-httpd/vhost-options.nix
parent57362d7d3ca6976c6c65fe4be85dc048152b7d3f (diff)
downloadnixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.tar
nixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.tar.gz
nixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.tar.bz2
nixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.tar.lz
nixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.tar.xz
nixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.tar.zst
nixpkgs-98e354074fdd30c23b8d64f5bc963d6a2c87a231.zip
nixos/httpd: add virtualHosts.<name>.listenAddresses option
Diffstat (limited to 'nixos/modules/services/web-servers/apache-httpd/vhost-options.nix')
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/vhost-options.nix21
1 files changed, 19 insertions, 2 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/vhost-options.nix b/nixos/modules/services/web-servers/apache-httpd/vhost-options.nix
index 394f9a30554..3f732a5c9f3 100644
--- a/nixos/modules/services/web-servers/apache-httpd/vhost-options.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/vhost-options.nix
@@ -47,10 +47,27 @@ in
       ];
       description = ''
         Listen addresses and ports for this virtual host.
-        <note><para>
+        <note>
+        <para>
           This option overrides <literal>addSSL</literal>, <literal>forceSSL</literal> and <literal>onlySSL</literal>.
-        </para></note>
+        </para>
+        <para>
+          If you only want to set the addresses manually and not the ports, take a look at <literal>listenAddresses</literal>.
+        </para>
+        </note>
+      '';
+    };
+
+    listenAddresses = mkOption {
+      type = with types; nonEmptyListOf str;
+
+      description = ''
+        Listen addresses for this virtual host.
+        Compared to <literal>listen</literal> this only sets the addreses
+        and the ports are chosen automatically.
       '';
+      default = [ "*" ];
+      example = [ "127.0.0.1" ];
     };
 
     enableSSL = mkOption {