File tree Expand file tree Collapse file tree 5 files changed +22
-0
lines changed
molecule/common/playbooks Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 0.x (Unreleased)
4
+
5
+ ENHANCEMENTS:
6
+
7
+ * Improve configuration templating capabilities:
8
+ * Allow setting ` access_log ` /` access_log_location ` to ` off ` .
9
+
3
10
## 0.1.0 (August 19, 2020)
4
11
5
12
Initial release of the NGINX Config role. Contains all NGINX Config related features previously available on the [ NGINX Ansible role] ( https://github.com/nginxinc/ansible-role-nginx ) .
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ nginx_config_http_template:
94
94
include_files : []
95
95
http_error_pages : {}
96
96
error_page : /usr/share/nginx/html
97
+ # access_log: "off" # Cancels all access_log directives on the current level
97
98
access_log :
98
99
- name : main
99
100
location : /var/log/nginx/access.log
Original file line number Diff line number Diff line change 76
76
http_error_pages :
77
77
404 : /404.html
78
78
error_page : /usr/share/nginx/html
79
+ access_log :
80
+ - name : main
81
+ location : /var/log/nginx/access.log
79
82
client_max_body_size : 512k
80
83
proxy_hide_headers :
81
84
- X-Powered-By
254
257
opts : []
255
258
server_name : localhost
256
259
error_page : /usr/share/nginx/html
260
+ access_log : " off"
257
261
autoindex : false
258
262
sub_filter :
259
263
sub_filters :
Original file line number Diff line number Diff line change @@ -491,10 +491,14 @@ server {
491
491
{% endif %}
492
492
493
493
{% if item .value .servers [server ].access_log is defined %}
494
+ {% if item .value .servers [server ].access_log is sameas false or item .value .servers [server ].access_log == "off" %}
495
+ access_log off;
496
+ {% else %}
494
497
{% for access_log in item .value .servers [server ].access_log %}
495
498
access_log {{ access_log.location }} {{ access_log.name }};
496
499
{% endfor %}
497
500
{% endif %}
501
+ {% endif %}
498
502
{% if item .value .servers [server ].error_log is defined %}
499
503
error_log {{ item.value.servers[server] .error_log.location }} {{ item.value.servers[server] .error_log.level }};
500
504
{% endif %}
Original file line number Diff line number Diff line change @@ -66,9 +66,15 @@ http {
66
66
log_format {{ access_log.name }} {{ access_log.format }};
67
67
{% endfor %}
68
68
69
+ {% if nginx_config_main_template .http_settings .access_log_location is defined %}
70
+ {% if nginx_config_main_template .http_settings .access_log_location is sameas false or nginx_config_main_template .http_settings .access_log_location == "off" %}
71
+ access_log off;
72
+ {% else %}
69
73
{% for access_log in nginx_config_main_template .http_settings .access_log_location %}
70
74
access_log {{ access_log.location }} {{ access_log.name }};
71
75
{% endfor %}
76
+ {% endif %}
77
+ {% endif %}
72
78
73
79
sendfile on;
74
80
You can’t perform that action at this time.
0 commit comments