2018-01-10 23:40:01 +01:00
|
|
|
---
|
2018-04-12 19:20:39 +02:00
|
|
|
- name: "(Setup: NGINX Open Source) Enable NGINX Open Source Status"
|
2018-01-10 23:40:01 +01:00
|
|
|
blockinfile:
|
2018-09-15 02:27:12 +02:00
|
|
|
path: "{{ (nginx_http_template_enable) | ternary('/etc/nginx/conf.d/http/stub_status.conf','/etc/nginx/conf.d/stub_status.conf') }}"
|
2018-01-10 23:40:01 +01:00
|
|
|
create: yes
|
|
|
|
block: |
|
|
|
|
server {
|
2019-05-21 17:23:06 +02:00
|
|
|
listen 127.0.0.1:{{ nginx_status_port | default('8080') }};
|
2018-01-19 19:27:47 +01:00
|
|
|
location /nginx_status {
|
|
|
|
stub_status on;
|
|
|
|
allow 127.0.0.1;
|
|
|
|
deny all;
|
|
|
|
}
|
2018-01-10 23:40:01 +01:00
|
|
|
}
|
2018-09-15 01:28:20 +02:00
|
|
|
when: nginx_type == "opensource"
|
2018-01-26 20:00:26 +01:00
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|
2018-01-10 23:40:01 +01:00
|
|
|
|
2018-01-26 20:00:26 +01:00
|
|
|
- name: "(Setup: NGINX Plus) Enable NGINX Plus Status"
|
2018-01-10 23:40:01 +01:00
|
|
|
blockinfile:
|
2018-09-15 02:27:12 +02:00
|
|
|
path: "{{ (nginx_http_template_enable) | ternary('/etc/nginx/conf.d/http/status.conf','/etc/nginx/conf.d/status.conf') }}"
|
2018-01-10 23:40:01 +01:00
|
|
|
create: yes
|
|
|
|
block: |
|
|
|
|
server {
|
2019-05-21 17:23:06 +02:00
|
|
|
listen 127.0.0.1:{{ nginx_status_port | default('8080') }};
|
2018-01-19 19:27:47 +01:00
|
|
|
location /status {
|
|
|
|
status;
|
|
|
|
allow 127.0.0.1;
|
|
|
|
deny all;
|
|
|
|
}
|
2018-01-10 23:40:01 +01:00
|
|
|
}
|
2018-09-15 01:28:20 +02:00
|
|
|
when: nginx_type == "plus"
|
2018-01-26 20:00:26 +01:00
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|