mirror of
https://github.com/geerlingguy/ansible-role-nginx.git
synced 2024-11-07 09:20:08 +01:00
3ea03870a6
Only add root if it's defined
31 lines
776 B
Django/Jinja
31 lines
776 B
Django/Jinja
{% for vhost in nginx_vhosts %}
|
|
server {
|
|
listen {{ vhost.listen | default('80 default_server') }};
|
|
server_name {{ vhost.server_name }};
|
|
|
|
{% if vhost.root is defined %}
|
|
root {{ vhost.root }};
|
|
{% endif %}
|
|
|
|
index {{ vhost.index | default('index.html index.htm') }};
|
|
|
|
{% if vhost.error_page is defined %}
|
|
error_page {{ vhost.error_page }};
|
|
{% endif %}
|
|
{% if vhost.access_log is defined %}
|
|
access_log {{ vhost.access_log }};
|
|
{% endif %}
|
|
{% if vhost.error_log is defined %}
|
|
error_log {{ vhost.error_log }} error;
|
|
{% endif %}
|
|
|
|
{% if vhost.return is defined %}
|
|
return {{ vhost.return }};
|
|
{% endif %}
|
|
|
|
{% if vhost.extra_parameters is defined %}
|
|
{{ vhost.extra_parameters }}
|
|
{% endif %}
|
|
}
|
|
{% endfor %}
|