@ -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 }}"
@ -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 }};