File tree Expand file tree Collapse file tree 4 files changed +23
-27
lines changed Expand file tree Collapse file tree 4 files changed +23
-27
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,11 @@ amplify_key: null
31
31
# Default is false.
32
32
status_enable : false
33
33
34
- # Enable NGINX Plus REST API and write access.
34
+ # Enable NGINX Plus REST API, write access to the REST API, and NGINX Plus dashboard .
35
35
# Default is false.
36
36
rest_api_enable : false
37
37
rest_api_write : false
38
-
39
- # Enable NGINX Plus dashboard. REST API also needs to be enabled.
40
- # Default is false.
41
- dashboard : false
38
+ rest_api_dashboard : false
42
39
43
40
# Location of your NGINX Plus license in your local machine.
44
41
# Default is the files folder within the NGINX Ansible role.
@@ -63,8 +60,8 @@ main_template_user: nginx
63
60
main_template_worker_processes : auto
64
61
main_template_error_level : warn
65
62
main_template_worker_connections : 1024
66
- main_template_keepalive_timeout : 65
67
63
http_template_enable : false
64
+ http_template_keepalive_timeout : 65
68
65
http_template_listen : 80
69
66
http_template_server_name : localhost
70
67
stream_template_enable : false
Original file line number Diff line number Diff line change 1
1
---
2
2
- name : " (Setup: NGINX Plus) Setup NGINX Plus API"
3
- template :
4
- src : api.conf.j2
5
- dest : " {{ (http_template_enable) | ternary('/etc/nginx/conf.d/http/api.conf','/etc/nginx/conf.d/api.conf') }}"
3
+ blockinfile :
4
+ path : " {{ (http_template_enable) | ternary('/etc/nginx/conf.d/http/api.conf','/etc/nginx/conf.d/api.conf') }}"
5
+ create : yes
6
+ block : |
7
+ server {
8
+ listen 8080;
9
+ location /api {
10
+ {% if rest_api_write %}
11
+ api write=on;
12
+ {% else %}
13
+ api;
14
+ {% endif %}
15
+ }
16
+ {% if rest_api_dashboard %}
17
+ location = /dashboard.html {
18
+ root /usr/share/nginx/html;
19
+ }
20
+ {% endif %}
21
+ }
6
22
notify : " (Handler: All OSs) Reload NGINX"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 23
23
sendfile on;
24
24
#tcp_nopush on;
25
25
26
- keepalive_timeout {{ main_template_keepalive_timeout }};
26
+ keepalive_timeout {{ http_template_keepalive_timeout }};
27
27
28
28
#gzip on;
29
29
You can’t perform that action at this time.
0 commit comments