ansible-role-nginx/tasks/conf/nginx-status.yml

35 lines
793 B
YAML
Raw Normal View History

2018-01-10 23:40:01 +01:00
---
- name: "(All OSs) Enable Open Source NGINX Status"
blockinfile:
path: /etc/nginx/conf.d/stub_status.conf
create: yes
block: |
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /nginx_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
}
when: type == "opensource"
notify: "(All OSs) Reload NGINX"
- name: "(All OSs) Enable NGINX Plus Status"
blockinfile:
path: /etc/nginx/conf.d/status.conf
create: yes
block: |
server {
listen 127.0.0.1:80;
server_name 127.0.0.1;
location /status {
status;
allow 127.0.0.1;
deny all;
}
}
when: type == "plus"
notify: "(All OSs) Reload NGINX"