From ffce7dea2e3b8427b836de7b1ca96e5c924e093e Mon Sep 17 00:00:00 2001 From: Valentin Constantinescu Date: Mon, 29 Apr 2019 09:20:59 +0200 Subject: [PATCH] added the possibility of adding more log_format rows --- defaults/main.yml | 2 ++ templates/nginx.conf.j2 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index cbce58a..44aff1f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -85,3 +85,5 @@ nginx_log_format: |- '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"' + +nginx_log_format_extra: "" diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 7cdec60..8d5f46c 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -31,6 +31,8 @@ http { log_format main {{ nginx_log_format|indent(23) }}; + {{ nginx_log_format_extra }} + access_log {{ nginx_access_log }}; sendfile {{ nginx_sendfile }};