504 Gateway Time-out in ISPmanager: site timeouts
A 504 Gateway Time-out means the script runs longer than the web server is ready to wait. Usually it is a product import, an export, a plugin backup or a heavy report. The Apache log may show Timeout waiting for output from CGI script.
Timeouts must be raised in the config of the site itself — in its VirtualHost and server blocks. Global server settings do not help: every site has its own virtual host with its own values.
Raise three limits to the same value, for example 3600 seconds: Apache, Nginx and PHP.
1. Open the site config
- Log in to ISPmanager as root. "Sites" → select the site → "Configuration files".

2. Apache: Timeout in the VirtualHost
- In the "Apache configuration file", inside
<VirtualHost 127.0.0.1:8080>, add the lineTimeout 3600— for example afterServerAdmin.
<VirtualHost 127.0.0.1:8080>
ServerName mydemo-site.com
...
Timeout 3600
...
</VirtualHost>
3. Nginx: timeouts in location @fallback
- In the "Nginx configuration file" find the
location @fallbackblock and add four lines to it. The block appears twice — for HTTP and for HTTPS. Add to both.
location @fallback {
...
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
send_timeout 3600;
}
- Click "Save". The panel checks the syntax and reloads the web servers.
The site runs on PHP-FPM without Apache — there is no @fallback block. Then add fastcgi_read_timeout 3600; to the location @php block and leave Apache alone.
4. PHP: execution time
Set the same max_execution_time and max_input_time for the site PHP version: the administrator — "PHP" → version → "Extended settings" (PHP settings), the user — in the PHP settings of their site (max_execution_time).
Checking
apache2ctl -t && nginx -tBoth commands must answer Syntax OK / test is successful. Run the long operation again.
The panel keeps edits made in "Configuration files". But if you change the site PHP mode or recreate the site, the config is rebuilt from the template — check the timeouts after such changes.
Restarting the web server
"Navigation board" → "Services" → select nginx or apache2 → "Restart the selected service".
