File: //sbin/init-scripts/prestart/nginx-error-log.sh
#!/bin/bash
if [[ "$X_APPLICATION_HTTP_SERVER" != "nginx" ]]; then
exit 0
fi
ERROR_LOG=""
case "$(echo $X_APPLICATION_ERROR_LOG | tr a-z A-Z)" in
ON) ERROR_LOG=1;;
TRUE) ERROR_LOG=1;;
YES) ERROR_LOG=1;;
ENABLED) ERROR_LOG=1;;
1) ERROR_LOG=1;;
esac
if [ -n "$ERROR_LOG" ]; then
mknod -m660 "/var/local/nginx/error.log" p
echo "
error_log \"/var/local/nginx/error.log\";
" >"/var/local/nginx/errorlog.conf"
else
echo "
error_log /dev/null;
" >"/var/local/nginx/errorlog.conf"
fi
exit 0