diff --git a/tasks/ssl/acme.yml b/tasks/ssl/acme.yml index 2667796..7714b30 100644 --- a/tasks/ssl/acme.yml +++ b/tasks/ssl/acme.yml @@ -19,7 +19,7 @@ - name: TEMPLATE | Create fake site template: - src: "etc/nginx/sites-available/_base.j2" + src: "etc/nginx/conf.d/FAKESITE.conf.j2" dest: "{{ nginx_etc_dir }}/conf.d/FAKESITE_{{ item | nginx_site_name }}.conf" with_items: "{{ acme_create }}" register: fake_site diff --git a/templates/etc/nginx/conf.d/FAKESITE.conf.j2 b/templates/etc/nginx/conf.d/FAKESITE.conf.j2 new file mode 100644 index 0000000..7055f2e --- /dev/null +++ b/templates/etc/nginx/conf.d/FAKESITE.conf.j2 @@ -0,0 +1,10 @@ +server { +{% for port in item.listen | default([80]) %} + listen {{ port }}; +{% endfor %} + server_name {% if item.name is string %}{{ item.name }}{% else %}{{ item.name | join(" ") }}{% endif %}{% if item.redirect_from is defined %} {% if item.redirect_from is string %}{{ item.redirect_from }}{% else %}{{ item.redirect_from | join(" ") }}{% endif %}{% endif %}; + + location / { + return 503; + } +}