mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-03-30 11:52:09 +07:00
Acme uses light fake sites
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
- name: TEMPLATE | Create fake site
|
- name: TEMPLATE | Create fake site
|
||||||
template:
|
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"
|
dest: "{{ nginx_etc_dir }}/conf.d/FAKESITE_{{ item | nginx_site_name }}.conf"
|
||||||
with_items: "{{ acme_create }}"
|
with_items: "{{ acme_create }}"
|
||||||
register: fake_site
|
register: fake_site
|
||||||
|
|||||||
10
templates/etc/nginx/conf.d/FAKESITE.conf.j2
Normal file
10
templates/etc/nginx/conf.d/FAKESITE.conf.j2
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user