Fixed Nginx images running under root

This commit is contained in:
Alexey Pustovalov 2024-07-05 13:21:12 +09:00
parent 092a94330c
commit 0e59c8e11f
18 changed files with 90 additions and 45 deletions

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -175,10 +178,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -175,10 +178,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -175,10 +178,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -175,10 +178,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user www-data;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="www-data"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -175,10 +178,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -162,10 +165,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -162,10 +165,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user nginx;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="nginx"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -162,10 +165,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}

View File

@ -1,4 +1,4 @@
#user nginx;
# user www-data;
worker_processes 5;
worker_rlimit_nofile 256000;

View File

@ -20,6 +20,9 @@ fi
# Default timezone for web interface
: ${PHP_TZ:="Europe/Riga"}
# Default user
: ${DAEMON_USER:="www-data"}
# Default directories
# Configuration files directory
ZABBIX_ETC_DIR="/etc/zabbix"
@ -162,10 +165,12 @@ prepare_zbx_web_config() {
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
if [ "$(id -u)" == '0' ]; then
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
echo "listen.group = nginx" >> "$PHP_CONFIG_FILE"
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.owner = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
echo "listen.group = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
fi
: ${ZBX_DENY_GUI_ACCESS:="false"}