You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

53 lines
1.3 KiB

{% block server_redirect %}
{% if item.server_name_redirect is defined %}
server {
listen {{ item.listen | default('80') }};
{% if nginx_listen_ipv6 %}
listen [::]:{{item.listen | default('80') }};
{% endif %}
server_name {{ item.server_name_redirect }};
return 301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;
}
{% endif %}
{% endblock %}
server {
{% block server_begin %}{% endblock %}
{% block server_basic -%}
listen {{ item.listen | default('80') }};
{% if nginx_listen_ipv6 %}
listen [::]:{{item.listen | default('80') }};
{% endif %}
{% if item.server_name is defined %}
server_name {{ item.server_name }};
{% endif %}
{% if item.root is defined %}
root {{ item.root }};
{% endif %}
index {{ item.index | default('index.html index.htm') }};
{% if item.error_page is defined %}
error_page {{ item.error_page }};
{% endif %}
{% if item.access_log is defined %}
access_log {{ item.access_log }};
{% endif %}
{% if item.error_log is defined %}
error_log {{ item.error_log }} error;
{% endif %}
{% if item.return is defined %}
return {{ item.return }};
{% endif %}
{% endblock %}
{% block server_end %}{% endblock %}
{% if item.extra_parameters is defined %}
{{ item.extra_parameters|indent(4) }}
{% endif %}
}