From aeccffbcf3d740b1ad0bcc82db564c90e6f2d74c Mon Sep 17 00:00:00 2001 From: ChrisAubuchon Date: Fri, 15 Jul 2016 02:51:04 -0500 Subject: [PATCH] Send access and error logs to stdout and stderr (#12) * Set nginx output logs to stdout/stderr * Terminate lines * Remove `set -x` unless DEBUG is set --- nginx/nginx.conf | 3 +++ scripts/nginx-run.sh | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 1e80f7b..cbc1b6d 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,4 +1,5 @@ worker_processes 1; +error_log /dev/stderr; events { worker_connections 1024; @@ -11,5 +12,7 @@ http { sendfile on; keepalive_timeout 65; + access_log /dev/stdout; + include /etc/nginx/conf/*.conf; } diff --git a/scripts/nginx-run.sh b/scripts/nginx-run.sh index 104b3c4..e003f1e 100755 --- a/scripts/nginx-run.sh +++ b/scripts/nginx-run.sh @@ -1,6 +1,7 @@ #!/bin/bash -set -x +#set the DEBUG env variable to turn on debugging +[[ -n "$DEBUG" ]] && set -x if [ ! -s /etc/nginx/nginx.conf ]; then exit 0