ansible-roles/roles/nginx/templates/ansible_conf.d/maintenance.inc.j2
2021-12-01 19:13:34 +01:00

10 lines
270 B
Django/Jinja

set $maintenance 1;
{% for ip in nginx_maintenance_ip %}
if ($remote_addr ~ "^{{ ip | replace('.','\.') }}") {
set $maintenance 0;
}
{% endfor %}
if ($maintenance = 1) {
rewrite (.*) https://downtime.{{ nginx_primary_domain | default(ansible_domain) }}/ redirect;
}