summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/nginx/vhost-options.nix
diff options
context:
space:
mode:
authorBob van der Linden <bobvanderlinden@gmail.com>2017-01-16 16:46:43 +0100
committerRobin Gloster <mail@glob.in>2017-01-25 14:55:55 +0100
commitd9987f360a72b97b346f13f7d5ec1bf58f284e52 (patch)
treea9018ab8d4d9eab6f6cf35e6832d582f0a87d6f3 /nixos/modules/services/web-servers/nginx/vhost-options.nix
parentb9b95aa4d44e9084bb6d5bbc3a1c7f2d32f45ff6 (diff)
downloadnixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.tar
nixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.tar.gz
nixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.tar.bz2
nixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.tar.lz
nixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.tar.xz
nixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.tar.zst
nixpkgs-d9987f360a72b97b346f13f7d5ec1bf58f284e52.zip
nginx: added serverName option for virtualHosts
This allows overriding the `server_name` attribute of virtual
hosts. By doing so it is possible to have multiple virtualHost
definitions that share the same `server_name`. This is useful in
particular when you need a HTTP as well as a HTTPS virtualhost: same
server_name, different port.
Diffstat (limited to 'nixos/modules/services/web-servers/nginx/vhost-options.nix')
-rw-r--r--nixos/modules/services/web-servers/nginx/vhost-options.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/services/web-servers/nginx/vhost-options.nix b/nixos/modules/services/web-servers/nginx/vhost-options.nix
index dcebbc9229f..c0ea645b3df 100644
--- a/nixos/modules/services/web-servers/nginx/vhost-options.nix
+++ b/nixos/modules/services/web-servers/nginx/vhost-options.nix
@@ -8,6 +8,15 @@
 with lib;
 {
   options = {
+    serverName = mkOption {
+      type = types.nullOr types.str;
+      default = null;
+      description = ''
+        Name of this virtual host. Defaults to attribute name in virtualHosts.
+      '';
+      example = "example.org";
+    };
+
     serverAliases = mkOption {
       type = types.listOf types.str;
       default = [];