redirect nginx logs to stdout/stderr

This commit is contained in:
Sameer Naik
2017-03-08 15:33:46 +05:30
parent 05cf8fd0aa
commit 3c890a555b

View File

@@ -8,6 +8,10 @@ check_for_updates &
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$(basename $1)" == "nginx" ]] || [[ "$1" == "/init.sh" ]]; then
nami_initialize nginx
# redirect nginx logs to stdout/stderr
ln -sf /dev/stdout /opt/bitnami/nginx/logs/access.log
ln -sf /dev/stderr /opt/bitnami/nginx/logs/error.log
# ensure nginx is not daemonized
if [[ "$(basename $1)" == "nginx" ]]; then
set -- "$@" -g 'daemon off;'