Using direct stdout / stderr for Nginx

This commit is contained in:
Alexey Pustovalov 2026-07-13 23:23:23 +09:00
parent 0f8c1c3048
commit 894791882a
23 changed files with 33 additions and 33 deletions

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -2,7 +2,7 @@ server_name zabbix;
index {HTTP_INDEX_FILE}; index {HTTP_INDEX_FILE};
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log notice; error_log stderr notice;
set $webroot '/usr/share/zabbix'; set $webroot '/usr/share/zabbix';

View file

@ -3,7 +3,7 @@ include /etc/nginx/includes/user.conf;
worker_processes 5; worker_processes 5;
worker_rlimit_nofile 256000; worker_rlimit_nofile 256000;
error_log /var/log/nginx/error.log error; error_log stderr error;
pid /tmp/nginx.pid; pid /tmp/nginx.pid;
@ -21,7 +21,7 @@ http {
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
include /etc/nginx/includes/access-log.conf; include /etc/nginx/includes/access-log.conf;
error_log /var/log/nginx/error.log error; error_log stderr error;
client_body_temp_path /tmp/client_body 1 2; client_body_temp_path /tmp/client_body 1 2;
proxy_temp_path /tmp/proxy 1 2; proxy_temp_path /tmp/proxy 1 2;

View file

@ -68,7 +68,7 @@ prepare_web_server() {
if [ "${ENABLE_WEB_ACCESS_LOG,,}" = "false" ]; then if [ "${ENABLE_WEB_ACCESS_LOG,,}" = "false" ]; then
printf 'access_log off;\n' > "${NGINX_INCLUDES_DIR}/access-log.conf" printf 'access_log off;\n' > "${NGINX_INCLUDES_DIR}/access-log.conf"
else else
printf 'access_log /var/log/nginx/access.log main;\n' > "${NGINX_INCLUDES_DIR}/access-log.conf" printf 'access_log /dev/stdout main;\n' > "${NGINX_INCLUDES_DIR}/access-log.conf"
fi fi
if [ -n "${WEB_REAL_IP_FROM:-}" ]; then if [ -n "${WEB_REAL_IP_FROM:-}" ]; then

View file

@ -21,7 +21,7 @@ prepare_runtime_commands() {
PHP_FPM_BIN="${PHP_FPM_BIN:-/usr/sbin/php-fpm}" PHP_FPM_BIN="${PHP_FPM_BIN:-/usr/sbin/php-fpm}"
PHP_FPM_CONFIG="${PHP_FPM_CONFIG:-/etc/php-fpm.conf}" PHP_FPM_CONFIG="${PHP_FPM_CONFIG:-/etc/php-fpm.conf}"
NGINX_ARGS=(-g 'daemon off;error_log /var/log/nginx/error.log error;' -c /etc/nginx/nginx.conf) NGINX_ARGS=(-e stderr -g 'daemon off;' -c "${NGINX_CONF_FILE}")
PHP_FPM_ARGS=(--nodaemonize --fpm-config "${PHP_FPM_CONFIG}") PHP_FPM_ARGS=(--nodaemonize --fpm-config "${PHP_FPM_CONFIG}")
} }

View file

@ -21,7 +21,7 @@ prepare_runtime_commands() {
PHP_FPM_BIN="${PHP_FPM_BIN:-/usr/sbin/php-fpm}" PHP_FPM_BIN="${PHP_FPM_BIN:-/usr/sbin/php-fpm}"
PHP_FPM_CONFIG="${PHP_FPM_CONFIG:-/etc/php-fpm.conf}" PHP_FPM_CONFIG="${PHP_FPM_CONFIG:-/etc/php-fpm.conf}"
NGINX_ARGS=(-g 'daemon off;error_log /var/log/nginx/error.log error;' -c /etc/nginx/nginx.conf) NGINX_ARGS=(-e stderr -g 'daemon off;' -c "${NGINX_CONF_FILE}")
PHP_FPM_ARGS=(--nodaemonize --fpm-config "${PHP_FPM_CONFIG}") PHP_FPM_ARGS=(--nodaemonize --fpm-config "${PHP_FPM_CONFIG}")
} }