mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2024-11-29 11:13:08 +01:00
Fixed Nginx images running under root
This commit is contained in:
parent
6205742aea
commit
e018c30303
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -173,10 +176,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -173,10 +176,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -173,10 +176,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -173,10 +176,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user www-data;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="www-data"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -173,10 +176,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -160,10 +163,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -160,10 +163,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user nginx;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="nginx"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -160,10 +163,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#user nginx;
|
# user www-data;
|
||||||
worker_processes 5;
|
worker_processes 5;
|
||||||
worker_rlimit_nofile 256000;
|
worker_rlimit_nofile 256000;
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ fi
|
|||||||
# Default timezone for web interface
|
# Default timezone for web interface
|
||||||
: ${PHP_TZ:="Europe/Riga"}
|
: ${PHP_TZ:="Europe/Riga"}
|
||||||
|
|
||||||
|
# Default user
|
||||||
|
: ${DAEMON_USER:="www-data"}
|
||||||
|
|
||||||
# Default directories
|
# Default directories
|
||||||
# Configuration files directory
|
# Configuration files directory
|
||||||
ZABBIX_ETC_DIR="/etc/zabbix"
|
ZABBIX_ETC_DIR="/etc/zabbix"
|
||||||
@ -160,10 +163,12 @@ prepare_zbx_web_config() {
|
|||||||
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
export PHP_FPM_PM_MAX_REQUESTS=${PHP_FPM_PM_MAX_REQUESTS:-"0"}
|
||||||
|
|
||||||
if [ "$(id -u)" == '0' ]; then
|
if [ "$(id -u)" == '0' ]; then
|
||||||
echo "user = zabbix" >> "$PHP_CONFIG_FILE"
|
sed -i -e "/^[#;] user/s/.*/&\nuser ${DAEMON_USER};/" "$NGINX_CONF_FILE"
|
||||||
echo "group = zabbix" >> "$PHP_CONFIG_FILE"
|
|
||||||
echo "listen.owner = nginx" >> "$PHP_CONFIG_FILE"
|
echo "user = ${DAEMON_USER}" >> "$PHP_CONFIG_FILE"
|
||||||
echo "listen.group = nginx" >> "$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
|
fi
|
||||||
|
|
||||||
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
: ${ZBX_DENY_GUI_ACCESS:="false"}
|
||||||
|
Loading…
Reference in New Issue
Block a user