From 38d9736beb3694590f9e2d424aeb263d8baa7197 Mon Sep 17 00:00:00 2001 From: Jay Rogers Date: Wed, 2 Oct 2024 13:55:39 -0500 Subject: [PATCH] Set NGINX fastcgi_read_timeout with PHP_MAX_EXECUTION_TIME (Fixes #424) --- src/s6/etc/entrypoint.d/10-init-webserver-config.sh | 2 +- .../fpm-nginx/etc/nginx/site-opts.d/http.conf.template | 1 + .../fpm-nginx/etc/nginx/site-opts.d/https.conf.template | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/s6/etc/entrypoint.d/10-init-webserver-config.sh b/src/s6/etc/entrypoint.d/10-init-webserver-config.sh index 062bc575..d5e9708e 100644 --- a/src/s6/etc/entrypoint.d/10-init-webserver-config.sh +++ b/src/s6/etc/entrypoint.d/10-init-webserver-config.sh @@ -41,7 +41,7 @@ process_template() { fi # Get all environment variables starting with 'NGINX_', 'SSL_', `LOG_`, and 'APACHE_' - subst_vars=$(env | grep -E '^(NGINX_|SSL_|LOG_|APACHE_)' | cut -d= -f1 | awk '{printf "${%s},",$1}' | sed 's/,$//') + subst_vars=$(env | grep -E '^(PHP_|NGINX_|SSL_|LOG_|APACHE_)' | cut -d= -f1 | awk '{printf "${%s},",$1}' | sed 's/,$//') # Validate that all required variables are set for var_name in $(echo "$subst_vars" | tr ',' ' '); do diff --git a/src/variations/fpm-nginx/etc/nginx/site-opts.d/http.conf.template b/src/variations/fpm-nginx/etc/nginx/site-opts.d/http.conf.template index 1a1b7439..91b7498b 100644 --- a/src/variations/fpm-nginx/etc/nginx/site-opts.d/http.conf.template +++ b/src/variations/fpm-nginx/etc/nginx/site-opts.d/http.conf.template @@ -39,6 +39,7 @@ location ~ \.php$ { include fastcgi_params; fastcgi_buffers $NGINX_FASTCGI_BUFFERS; fastcgi_buffer_size $NGINX_FASTCGI_BUFFER_SIZE; + fastcgi_read_timeout $PHP_MAX_EXECUTION_TIME; } # additional config diff --git a/src/variations/fpm-nginx/etc/nginx/site-opts.d/https.conf.template b/src/variations/fpm-nginx/etc/nginx/site-opts.d/https.conf.template index 9fd861b4..f98a71f1 100644 --- a/src/variations/fpm-nginx/etc/nginx/site-opts.d/https.conf.template +++ b/src/variations/fpm-nginx/etc/nginx/site-opts.d/https.conf.template @@ -45,6 +45,7 @@ location ~ \.php$ { include fastcgi_params; fastcgi_buffers $NGINX_FASTCGI_BUFFERS; fastcgi_buffer_size $NGINX_FASTCGI_BUFFER_SIZE; + fastcgi_read_timeout $PHP_MAX_EXECUTION_TIME; } # additional config