Symptoms
-
Unable to log in to webmail service or perform some operations fail once already logged into webmail, with error:
504 Gateway Time-out
-
When importing a mailbox via webmail service, the following error is shown in the browser console:
Failed to load resource: the server responded with a status of 504 ()
Connection Error (Failed to reach the server)!
-
In Nginx log file
/var/log/nginx/error.log
one of the following error messages might be found:[error] 12026#0: *1721 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 203.0.113.2, server: webmail.example.com, request: "POST /services/ajax.php/imp/viewPort HTTP/1.1", upstream: "http://203.0.113.1:7080/services/ajax.php/imp/viewPort", host: "webmail.example.com", referrer: "http://webmail.example.com/imp/dynamic.php?page=mailbox"
Cause
Insufficient timeout values are configured.
Resolution
For Plesk on RHEL / CentOS / CloudLinux
-
Connect to the server via SSH
-
Edit the Webmail
php.ini
file and increasemax_execution_time
andmax_input_time
values:-
For Horde:
/etc/psa-webmail/horde/horde/php.ini
# egrep "max_execution_time|max_input_time" /etc/psa-webmail/horde/horde/php.ini
max_input_time = 600
max_execution_time = 300 -
For RoundCube:
/etc/psa-webmail/roundcube/php.ini
# egrep "max_execution_time|max_input_time" /etc/psa-webmail/roundcube/php.ini
max_input_time = 600
max_execution_time = 300 -
For Plesk Premium Mail:
/usr/local/psa/var/modules/kolab/webmail/php.ini
# egrep "max_execution_time|max_input_time" /usr/local/psa/var/modules/kolab/webmail/php.ini
max_input_time = 600
max_execution_time = 300
-
-
Edit the Apache configuration
/etc/httpd/conf.d/fcgid.conf
and increaseFcgidIOTimeout
value:# grep FcgidIOTimeout /etc/httpd/conf.d/fcgid.conf
FcgidIOTimeout 300 -
Edit the Nginx configuration file
/etc/nginx/nginx.conf
adding the following directives inside thehttp {}
code section:proxy_send_timeout 300s;
proxy_read_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s; -
Reload Apache service:
# service httpd reload
-
Reload Nginx service:
# service nginx reload
For Plesk on Debian / Ubuntu
-
Connect to the server via SSH
-
Edit the Webmail
php.ini
file and increasemax_execution_time
andmax_input_time
values:-
For Horde:
/etc/psa-webmail/horde/horde/php.ini
# egrep "max_execution_time|max_input_time" /etc/psa-webmail/horde/horde/php.ini
max_input_time = 600
max_execution_time = 300 -
For RoundCube:
/etc/psa-webmail/roundcube/php.ini
# egrep "max_execution_time|max_input_time" /etc/psa-webmail/roundcube/php.ini
max_input_time = 600
max_execution_time = 300 -
For Plesk Premium Mail:
/opt/psa/var/modules/kolab/webmail/php.ini
# egrep "max_execution_time|max_input_time" /opt/psa/var/modules/kolab/webmail/php.ini
max_input_time = 600
max_execution_time = 300
-
-
Edit the Apache configuration
/etc/apache2/mods-enabled/fcgid.conf
and increaseFcgidIOTimeout
value:# grep FcgidIOTimeout /etc/apache2/mods-enabled/fcgid.conf
FcgidIOTimeout 300 -
Edit the Nginx configuration file
/etc/nginx/nginx.conf
adding the following directives inside thehttp {}
code section:proxy_send_timeout 300s;
proxy_read_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s; -
Reload Apache service:
# service apache2 reload
-
Reload Nginx service:
# service nginx reload