diff --git a/README.md b/README.md index 47b6456..1aebe49 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Run this role after you have installed fail2ban. | `nginx_gzip` | | [documentation](https://nginx.org/en/docs/http/ngx_http_gzip_module.html) | | `nginx_gzip_types` | --> `defaults/main.yaml` | | | `nginx_server_tokens` | `off` | | +| `nginx_access_log` | `off` | Path and configuration for access log | | `dhparam_path` | `/etc/ssl/private/dhparam.pem` | Path to dhparam file | | `dhparam_size` | `4096` | Size (in bits) of the generated DH-params | diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 60c3093..be990aa 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -39,8 +39,10 @@ http { '"$host" "$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" "$request_time" seconds'; - #access_log /var/log/nginx/access.log noip if=$log_ip; - access_log off; + # Log no IP addresses + # access_log /var/log/nginx/access.log noip if=$log_ip; + + access_log {{ nginx_access_log | default(off) }}; error_log /var/log/nginx/error.log;