2019-05-22 18:27:47 +02:00
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
|
|
|
|
server {
|
2019-11-18 17:14:00 +01:00
|
|
|
listen {{ nginx_rest_api_port | default('80') }};
|
2020-07-22 16:19:43 +02:00
|
|
|
access_log {{ nginx_rest_api_log | ternary('on', 'off') }};
|
2019-05-22 18:27:47 +02:00
|
|
|
location /api {
|
|
|
|
{% if nginx_rest_api_write %}
|
|
|
|
api write=on;
|
|
|
|
{% else %}
|
|
|
|
api;
|
2020-07-22 16:19:43 +02:00
|
|
|
{% endif %}
|
|
|
|
{% if nginx_status_rest_api_allow is defined %}
|
|
|
|
allow {{ nginx_status_rest_api_allow }};
|
|
|
|
{% endif %}
|
|
|
|
{% if nginx_status_rest_api_deny is defined %}
|
|
|
|
deny {{ nginx_status_rest_api_deny }};
|
2019-05-22 18:27:47 +02:00
|
|
|
{% endif %}
|
|
|
|
}
|
|
|
|
{% if nginx_rest_api_dashboard %}
|
|
|
|
location = /dashboard.html {
|
|
|
|
root /usr/share/nginx/html;
|
2020-07-22 16:19:43 +02:00
|
|
|
{% if nginx_status_rest_api_dashboard_allow is defined %}
|
|
|
|
allow {{ nginx_status_rest_api_dashboard_allow }};
|
|
|
|
{% endif %}
|
|
|
|
{% if nginx_status_rest_api_dashboard_deny is defined %}
|
|
|
|
deny {{ nginx_status_rest_api_dashboard_deny }};
|
|
|
|
{% endif %}
|
2019-05-22 18:27:47 +02:00
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
}
|