diff --git a/tasks/vhosts.yml b/tasks/vhosts.yml index 6af3173..8e7ff76 100755 --- a/tasks/vhosts.yml +++ b/tasks/vhosts.yml @@ -1,4 +1,8 @@ --- +- name: Creates Nginx conf directories + file: path={{ nginx_vhost_path }} state=directory mode=0755 recurse=yes + when: nginx_vhosts|length > 0 + - name: Remove default nginx vhost config file (if configured). file: path: "{{ nginx_default_vhost_path }}" diff --git a/templates/vhosts.j2 b/templates/vhosts.j2 index 20bcf6f..04dbf9e 100755 --- a/templates/vhosts.j2 +++ b/templates/vhosts.j2 @@ -1,6 +1,6 @@ {% for vhost in nginx_vhosts %} server { - listen {{ vhost.listen | default('80') }}; + listen {{ vhost.listen | default('80 default_server') }}; {% if vhost.server_name is defined %} server_name {{ vhost.server_name }};