Yes you could.
Which one is right tried the most common one but nope…
There are several ways to fix it:
-
For Nginx as Proxy (php-fpm disabled) To apply settings globally, increase the following timeout values by adding the file
/etc/nginx/conf.d/timeout.conf
and restarting ‘nginx’ service: # cat /etc/nginx/conf.d/timeout.conf
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
If you only are able to increase timeout settings per domain, it can be done in this way: Plesk > Subscriptions > my.domain.com > Websites & Domains > Web Server Settings – add the lines to Additional Nginx directives
-
For Nginx + FastCGI (php-fpm enabled) Increase
max_execution_time
setting: Plesk > Subscriptions > test.com > Websites & Domains > test.com > PHP Settings – Set max_execution_time = 300
Change request_terminate_timeout
parameter (commented by default) in /etc/php-fpm.d/www.conf
(for Debian /etc/php5/fpm/pool.d/www.conf
) file:
request_terminate_timeout = 300
Add fastcgi_read_timeout
variable inside the ‘nginx’ virtual host configuration: Plesk > Subscriptions > my.domain.com > Websites & Domains > Web Server Settings > Additional Nginx directives
fastcgi_read_timeout 300;
Add/increase the following values in the ‘http’ section of the /etc/nginx/nginx.conf
file:
fastcgi_buffers 8 128k;
fastcgi_buffer_size 256k;
Restart both ‘apache’ and ‘nginx’.
==========================================
If above steps doesn’t work, try this one…
- Open your
nginx.conf
file located in /etc/nginx
directory.
- Add this below piece of code under
http {
section:
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
client_max_body_size 32m;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
Note: If its already present , change the values according.
3. Reload Nginx and php5-fpm.
$ service nginx reload
$ service php5-fpm reload
If the error persists, consider increasing the values.
=========================================
Changes in php.ini
Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini):
1 max_execution_time = 150
Changes in PHP-FPM
Try raising request_terminate_timeout setting in php.ini file (CentOS path is /etc/php-fpm.d):
1 request_terminate_timeout = 150
Changes in Nginx Config
Finally, add fastcgi_read_timeout variable inside our Nginx virtual host configuration:
1
2
3
4
5
6
7 location ~* .php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_read_timeout 150;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Reload PHP-FPM and Nginx
1
2 service php–fpm restart
service nginx restart