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 88d1861837
commit fd37261da0
56 changed files with 238 additions and 70 deletions

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;
}
@ -65,7 +64,7 @@ server {
try_files $fastcgi_script_name =404;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param DOCUMENT_ROOT $webroot;
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;
@ -70,7 +70,6 @@ server {
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
@ -84,7 +83,7 @@ server {
try_files $fastcgi_script_name =404;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index index.php;
fastcgi_index {HTTP_INDEX_FILE};
fastcgi_param DOCUMENT_ROOT $webroot;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;

View File

@ -237,10 +237,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"}