public-health-ch/ansible/roles/nginxinc.nginx/tasks/conf/setup-status.yml

33 lines
881 B
YAML
Raw Normal View History

2020-05-15 22:14:14 +00:00
---
- name: "(Setup: NGINX Open Source) Enable NGINX Open Source Status"
blockinfile:
path: "{{ nginx_status_location }}"
create: yes
block: |
server {
listen 127.0.0.1:{{ nginx_status_port | default('80') }};
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
when: nginx_type == "opensource"
notify: "(Handler: All OSs) Reload NGINX"
- name: "(Setup: NGINX Plus) Enable NGINX Plus Status"
blockinfile:
path: "{{ nginx_status_location }}"
create: yes
block: |
server {
listen 127.0.0.1:{{ nginx_status_port | default('80') }};
location /status {
status;
allow 127.0.0.1;
deny all;
}
}
when: nginx_type == "plus"
notify: "(Handler: All OSs) Reload NGINX"