2018-02-20 21:28:14 +01:00
|
|
|
---
|
|
|
|
- name: "(Setup: NGINX Plus) Setup NGINX Plus API"
|
2018-04-07 01:29:49 +02:00
|
|
|
blockinfile:
|
2018-09-15 02:27:12 +02:00
|
|
|
path: "{{ (nginx_http_template_enable) | ternary('/etc/nginx/conf.d/http/api.conf','/etc/nginx/conf.d/api.conf') }}"
|
2018-04-07 01:29:49 +02:00
|
|
|
create: yes
|
|
|
|
block: |
|
|
|
|
server {
|
|
|
|
listen 8080;
|
|
|
|
location /api {
|
2018-09-15 02:27:12 +02:00
|
|
|
{% if nginx_rest_api_write %}
|
2018-04-07 01:29:49 +02:00
|
|
|
api write=on;
|
|
|
|
{% else %}
|
|
|
|
api;
|
|
|
|
{% endif %}
|
|
|
|
}
|
2018-09-15 02:27:12 +02:00
|
|
|
{% if nginx_rest_api_dashboard %}
|
2018-04-07 01:29:49 +02:00
|
|
|
location = /dashboard.html {
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
}
|
2018-02-20 21:28:14 +01:00
|
|
|
notify: "(Handler: All OSs) Reload NGINX"
|