<NME> vhost.j2
<BEF> {% block server_redirect %}
{% if item.server_name_redirect is defined %}
    listen       {{ item.listen | default('80') }};
    server_name  {{ item.server_name_redirect }};
    return       301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;
{% 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 %}
}

<MSG> Update to latest version of Nginx role.

<DFF> @@ -1,5 +1,6 @@
 {% block server_redirect %}
 {% if item.server_name_redirect is defined %}
+server {
     listen       {{ item.listen | default('80') }};
     server_name  {{ item.server_name_redirect }};
     return       301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;

{'commit': "diff --git a/provisioning/requirements.yml b/provisioning/requirements.yml\nindex 960dfc7..aae1876 100644\n--- a/provisioning/requirements.yml\n+++ b/provisioning/requirements.yml\n@@ -38,7 +38,7 @@\n - src: geerlingguy.mysql\n   version: 2.7.2\n - src: geerlingguy.nginx\n-  version: 2.3.0\n+  version: 2.3.1\n - src: geerlingguy.nodejs\n   version: 4.1.1\n - src: geerlingguy.php\ndiff --git a/provisioning/roles/geerlingguy.nginx/templates/vhost.j2 b/provisioning/roles/geerlingguy.nginx/templates/vhost.j2\nindex 40beced..0feb602 100644\n--- a/provisioning/roles/geerlingguy.nginx/templates/vhost.j2\n+++ b/provisioning/roles/geerlingguy.nginx/templates/vhost.j2\n@@ -1,5 +1,6 @@\n {% block server_redirect %}\n {% if item.server_name_redirect is defined %}\n+server {\n     listen       {{ item.listen | default('80') }};\n     server_name  {{ item.server_name_redirect }};\n     return       301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;\n", 'commit_subject': 'Update to latest version of Nginx role.', 'repo_name': 'geerlingguy/drupal-vm', 'committer': {'name': 'Jeff Geerling', 'email': 'c9d4aa5dde5e46bc331eaedc9231c409ab208b10@mac.com', 'time_sec': '1496874677', 'tz_offset': '-300', 'date': {'seconds': '1496874677'}}, 'commit_tree': '656aafcd6c6880c4da09db68cc52e0f48c9b289b', 'commit_message': 'Update to latest version of Nginx role.\n', 'language_name': 'Ruby', 'license': 'mit', 'hunks': "@@ -1,5 +1,6 @@\n {% block server_redirect %}\n {% if item.server_name_redirect is defined %}\n+server {\n     listen       {{ item.listen | default('80') }};\n     server_name  {{ item.server_name_redirect }};\n     return       301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;\n", 'addition_count': 1, 'deletion_count': 0, 'src_file': 'a/provisioning/roles/geerlingguy.nginx/templates/vhost.j2', 'tgt_file': 'b/provisioning/roles/geerlingguy.nginx/templates/vhost.j2', 'file_extension': '.j2', 'before_file': "{% block server_redirect %}\n{% if item.server_name_redirect is defined %}\n    listen       {{ item.listen | default('80') }};\n    server_name  {{ item.server_name_redirect }};\n    return       301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;\n{% endif %}\n    server_name  {{ item.server_name_redirect }};\n    return       301 $scheme://{{ item.server_name.split(' ')[0] }}$request_uri;\n}\n{% endif %}\n{% endblock %}\n\nserver {\n    {% block server_begin %}{% endblock %}\n\n    {% block server_basic -%}\n    listen {{ item.listen | default('80') }};\n{% if nginx_listen_ipv6 %}\n    listen       [::]:{{item.listen | default('80') }};\n{% endif %}\n\n{% if item.server_name is defined %}\n    server_name {{ item.server_name }};\n{% endif %}\n\n{% if item.root is defined %}\n    root {{ item.root }};\n{% endif %}\n\n    index {{ item.index | default('index.html index.htm') }};\n\n{% if item.error_page is defined %}\n    error_page {{ item.error_page }};\n{% endif %}\n{% if item.access_log is defined %}\n    access_log {{ item.access_log }};\n{% endif %}\n{% if item.error_log is defined %}\n    error_log {{ item.error_log }} error;\n{% endif %}\n\n{% if item.return is defined %}\n    return {{ item.return }};\n{% endif %}\n    {% endblock %}\n\n    {% block server_end %}{% endblock %}\n\n{% if item.extra_parameters is defined %}\n    {{ item.extra_parameters|indent(4) }}\n{% endif %}\n}\n", 'message': 'Update to latest version of Nginx role.\n', 'author_name': 'Jeff Geerling', 'lang': 'nginx/templates/vhost'}