12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- {% for x509 in vhosts_x509.results %}
- {%- set vhost = x509.vhost -%}
- {%- set ssl = vhost.ssl | default(false) -%}
- server {
- listen
- {%- if ssl %}
- {{ vhost.listen | default('443') }} ssl
- {%- else %}
- {{ vhost.listen | default('80') }}
- {%- endif -%}
- {%- if vhost.default_server | default(false) %}
- default_server
- {%- endif -%}
- ;
- {% if vhost.server_name is defined %}
- server_name {{ vhost.server_name }};
- {% endif %}
- {% if ssl %}
- ssl_certificate "{{ x509.cert_path }}";
- ssl_certificate_key "{{ x509.key_path }}";
- {% endif %}
- {% 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|indent(4) }}
- {% endif %}
- }
- {% endfor %}
|