From 44ccef07a8d98106b7869f9e36264d16a4bff213 Mon Sep 17 00:00:00 2001 From: Tim de Pater Date: Wed, 16 Mar 2016 14:54:20 +0100 Subject: [PATCH] Added response time info to Nginx logging --- config/nginx.conf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/nginx.conf b/config/nginx.conf index 92f2e22..4e67703 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -8,6 +8,14 @@ http { include mime.types; default_type application/octet-stream; + log_format main_timed '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for" ' + '$request_time $upstream_response_time $pipe $upstream_cache_status'; + + access_log /dev/stdout main_timed; + error_log /dev/stderr info; + keepalive_timeout 65; server { @@ -20,9 +28,6 @@ http { root /var/www/html; index index.php index.html; - error_log /dev/stderr info; - access_log /dev/stdout; - location / { # First attempt to serve request as file, then # as directory, then fall back to index.php