Configure logging

This commit is contained in:
phil 2023-03-11 21:39:23 +01:00
parent 32a1d2708f
commit 0186e7ad6c
2 changed files with 5 additions and 2 deletions

View file

@ -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` | | [documentation](https://nginx.org/en/docs/http/ngx_http_gzip_module.html) |
| `nginx_gzip_types` | --> `defaults/main.yaml` | | | `nginx_gzip_types` | --> `defaults/main.yaml` | |
| `nginx_server_tokens` | `off` | | | `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_path` | `/etc/ssl/private/dhparam.pem` | Path to dhparam file |
| `dhparam_size` | `4096` | Size (in bits) of the generated DH-params | | `dhparam_size` | `4096` | Size (in bits) of the generated DH-params |

View file

@ -39,8 +39,10 @@ http {
'"$host" "$request" $status $body_bytes_sent ' '"$host" "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$request_time" seconds'; '"$http_referer" "$http_user_agent" "$request_time" seconds';
# Log no IP addresses
# access_log /var/log/nginx/access.log noip if=$log_ip; # access_log /var/log/nginx/access.log noip if=$log_ip;
access_log off;
access_log {{ nginx_access_log | default(off) }};
error_log /var/log/nginx/error.log; error_log /var/log/nginx/error.log;