Browse Source

make the "server_name" directive optional

Benjamin Smith 9 years ago
parent
commit
102949fcb8
1 changed files with 3 additions and 0 deletions
  1. 3 0
      templates/vhosts.j2

+ 3 - 0
templates/vhosts.j2

@@ -1,7 +1,10 @@
 {% for vhost in nginx_vhosts %}
 server {
     listen {{ vhost.listen | default('80 default_server') }};
+
+    {% if vhost.server_name is defined %}
     server_name {{ vhost.server_name }};
+    {% endif %}
 
     {% if vhost.root is defined %}
     root {{ vhost.root }};