fix: move error log to stderr globally
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Robert Kaussow 2023-09-25 00:35:09 +02:00
parent 3d71062d4b
commit 3ee6e3c6ff
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 13 additions and 13 deletions

View File

@ -38,7 +38,7 @@ RUN mkdir -p /var/www /etc/nginx-s3 /etc/nginx/conf.d /var/tmp/nginx /var/cache/
touch /run/nginx.pid && \
touch /etc/nginx/conf.d/vhosts.conf && \
chown nginx /run/nginx.pid && \
chown -R nginx /var/log/nginx /var/tmp/nginx /var/cache/nginx && \
chown -R nginx /var/tmp/nginx /var/cache/nginx && \
chown -R nginx:nginx /var/www && \
chown -R root:nginx /etc/nginx /etc/nginx/conf.d && \
chmod -R 640 /etc/nginx /etc/nginx/conf.d && \

View File

@ -1,21 +1,21 @@
worker_processes 1;
pid /var/run/nginx.pid;
error_log stderr error;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
access_log off;
error_log /dev/stderr;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
access_log off;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;

View File

@ -8,12 +8,12 @@ set -eo pipefail
start_server() {
log_info "Start nginx server"
if ! nginx -q -g 'daemon off;' -t; then
if ! nginx -e stderr -q -g 'daemon off;' -t; then
log_error 'Nginx config validation failed, exit'
exit 1
fi
exec nginx -g "daemon off;" &
exec nginx -e stderr -g "daemon off;" &
PID=$!
{
@ -21,7 +21,7 @@ start_server() {
inotifywait -rq --timefmt "%F %T" --format "%T [INFO] [$(basename "$0")] %e %f" -e modify,move,create,delete /etc/nginx/
log_info 'Detected nginx config update, run validation'
if ! nginx -q -g 'daemon off;' -t; then
if ! nginx -e stderr -q -g 'daemon off;' -t; then
log_warn 'Nginx config validation failed, skip reload'
continue
fi