From ddf20876f8befe59db3fdd5bd52507e1c8173ca7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu>
Date: Tue, 21 Feb 2017 15:24:30 +0100
Subject: [PATCH] fix log format for nginx cache stats in munin, fixes #20546

---
 2.Common_services/5.Nginx/vhost_cache.conf | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/2.Common_services/5.Nginx/vhost_cache.conf b/2.Common_services/5.Nginx/vhost_cache.conf
index 5fda7150..2dd592ea 100644
--- a/2.Common_services/5.Nginx/vhost_cache.conf
+++ b/2.Common_services/5.Nginx/vhost_cache.conf
@@ -1,5 +1,10 @@
 proxy_cache_path /tmp/nginx-uc-cache levels=1:2 keys_zone=uc-cache:10m max_size=10g inactive=300s;
 
+log_format cache '$remote_addr - $host [$time_local] "$request" $status '
+    '$body_bytes_sent "$http_referer" '
+    'rt=$request_time ut="$upstream_response_time" '
+    'cs=$upstream_cache_status';
+
 server {
     listen 80 default_server;
     listen 443 default_server ssl;
@@ -7,7 +12,7 @@ server {
 
     root /var/www/cache/;
 
-    access_log /var/log/nginx/access_cache.log;
+    access_log /var/log/nginx/access_cache.log cache;
     error_log /var/log/nginx/error_cache.log;
 
     location /crossdomain {
-- 
GitLab