Introduced new HTTP_INDEX_FILE variable to control index page

This commit is contained in:
Alexey Pustovalov
2024-01-20 20:40:13 +09:00
parent bd4033c90f
commit e0a5779ce7
56 changed files with 238 additions and 70 deletions

View File

@ -137,6 +137,10 @@ Use IEEE754 compatible value range for 64-bit Numeric (float) history values. Av
The variable sets the Access Log directive for Web-server. By default, value corresponds to standard output.
### `HTTP_INDEX_FILE`
The variable controls default index page. By default, `index.php`.
### `ZBX_MAXEXECUTIONTIME`
The varable is PHP ``max_execution_time`` option. By default, value is `300`.

View File

@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name zabbix;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
@ -51,7 +51,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -61,7 +60,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -5,7 +5,7 @@ server {
server_name zabbix;
server_name_in_redirect off;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
@ -78,7 +78,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -88,7 +87,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -234,10 +234,19 @@ prepare_zbx_web_config() {
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then
sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi
: ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name zabbix;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
@ -51,7 +51,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -61,7 +60,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -5,7 +5,7 @@ server {
server_name zabbix;
server_name_in_redirect off;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
@ -78,7 +78,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -88,7 +87,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -234,10 +234,19 @@ prepare_zbx_web_config() {
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then
sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi
: ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name zabbix;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
@ -51,7 +51,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -61,7 +60,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -5,7 +5,7 @@ server {
server_name zabbix;
server_name_in_redirect off;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
@ -78,7 +78,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -88,7 +87,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -234,10 +234,19 @@ prepare_zbx_web_config() {
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then
sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi
: ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name zabbix;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
@ -51,7 +51,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -61,7 +60,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -5,7 +5,7 @@ server {
server_name zabbix;
server_name_in_redirect off;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
@ -78,7 +78,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -88,7 +87,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -234,10 +234,19 @@ prepare_zbx_web_config() {
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then
sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi
: ${ENABLE_WEB_ACCESS_LOG:="true"}

View File

@ -3,7 +3,7 @@ server {
listen [::]:8080;
server_name zabbix;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
@ -51,7 +51,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -61,7 +60,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -5,7 +5,7 @@ server {
server_name zabbix;
server_name_in_redirect off;
index index.php;
index {HTTP_INDEX_FILE};
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
@ -78,7 +78,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -88,7 +87,7 @@ server {
location ~ .php$ {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -234,10 +234,19 @@ prepare_zbx_web_config() {
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
: ${HTTP_INDEX_FILE:="index.php"}
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx.conf"
if [ -f "$ZABBIX_ETC_DIR/nginx_ssl.conf" ]; then
sed -i \
-e "s/{FCGI_READ_TIMEOUT}/${FCGI_READ_TIMEOUT}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
sed -i \
-e "s/{HTTP_INDEX_FILE}/${HTTP_INDEX_FILE}/g" \
"$ZABBIX_ETC_DIR/nginx_ssl.conf"
fi
: ${ENABLE_WEB_ACCESS_LOG:="true"}