Skip to content Skip to sidebar Skip to footer

Apache Proxy Error Reading Status Line From Remote Server

The 504 Gateway Timeout error is one of the most common HTTP 5xx errors faced by website owners and site visitors. For many WordPress blogs and ecommerce platforms, knowing how to prepare server errors like this is crucial to continue their hard-earned visitors from bouncing to competitor sites.

Every bit the 504 Gateway Timeout error doesn't tell you why information technology occurred, it's hard to pinpoint what'south causing the server timeout. This article will help you empathise it in detail, learn how to diagnose its cause, so fix it.

After trying all the various solutions mentioned in the mail service, your site should be up and running in no time.

Sounds interesting? Let's dive in!

Prefer to picket the video version?

The 504 Gateway Timeout fault is one of the nigh mutual HTTP 5xx errors faced past website owners and site visitors. 🤔 Learn how to fix it with this guide quickly. ⬇️ Click to Tweet

What Is the 504 Gateway Timeout Error?

Every time you lot visit a website in your browser, the browser sends a request to the web server where the site is hosted. The server processes the request and responds with the requested resources.

Illustration of how HTTP requests and responses work
How HTTP requests and responses work.

The server response includes i of many HTTP status codes to indicate the response's status to the browser. But not all these HTTP status codes are errors. For case, a 200 OK status code means that the server processed the request successfully and "Everything is OK."

The 5xx course of HTTP status codes indicates that something's wrong with the server, the server is aware of information technology, and it cannot carry out the client request. As a result, they're also referred to as Server Mistake 5xx status codes.

Officially, five status codes are specified under the 5xx form (500, 501, 502, 503, 504). Y'all may come upon many unofficial codes too (506, 507, 509, 520, etc.).

The Net Engineering Task Force (IETF) defines the 504 Gateway Timeout error as:

The 504 (Gateway Timeout) status lawmaking indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in lodge to complete the request.

To simplify information technology farther, this error occurs when two servers are involved in processing a asking. The offset server (typically the main server) times out, waiting for a response from the 2d server (upstream server).

The 504 Gateway Timeout error manifests itself in diverse forms. Here are some means it usually shows upwards:

The HTTP ERROR 504 in Chrome browser
The 'HTTP Fault 504' in the Chrome browser.

The 504 Gateway Timeout mistake is similar to the 502 Bad Gateway error, which indicates that the outset server received an invalid response from the second server (upstream server).

504 GATEWAY TIMEOUT status code in Chrome DevTools
The '504 GATEWAY TIMEOUT' status code in Chrome DevTools.

Variations of the 504 Gateway Timeout Error

The browser displays any 504 Gateway Timeout fault inside information technology, just like whatsoever other fault. Equally at that place are various operating systems, web servers, browsers, and user agents, information technology tin show upward in multiple ways.

Below are a few common 504 error message variations that you may come across:

  • 504 Gateway Timeout
  • 504 Gateway Timeout NGINX
  • NGINX 504 Gateway Timeout
  • Gateway Timeout Error
  • Error 504
  • HTTP Error 504
  • HTTP Mistake 504 — Gateway Timeout
  • HTTP 504
  • 504 Error
  • Gateway Timeout (504)
  • This page isn't working — Domain took too long to respond
  • 504 Gateway Time-out — The server didn't respond in time
  • A blank white screen

All the in a higher place fault responses, though worded differently, point to the same 504 Gateway Timeout server error.

Web servers and websites can customize how they prove the 504 Gateway Timeout mistake to users. Some of them can be cool! It's an excellent tactic to quell their visitors' disappointment.

GitHub's customized HTTP 504 error page
GitHub's customized HTTP 504 error page.

SEO Impact of the 504 Gateway Timeout Fault

All 5xx errors prevent a webpage from loading, making them detrimental to user experience. Hence, search engines like Google have these errors seriously. If the error persists for a long elapsing, it may even atomic number 82 to deindexing the webpage from the search engine results.

For example, when Google spiders stumble upon a 503 Service Unavailable error, they'll sympathise that it's a temporary issue equally it's mostly used to enable site maintenance way. Thus, they'll try to crawl the folio over again later.

A 504 Gateway Timeout mistake isn't necessarily temporary as it can exist due to multiple reasons. If your site is down for just a few minutes, and if the spiders are trying to crawl it multiple times every infinitesimal, they'll try to serve the page from their cache.  They wouldn't even discover it.

But if your site is down for half dozen+ hours or more, then Google will consider the 504 error as a serious site-wide result that you demand to fix equally presently every bit possible. This can touch on your SEO negatively.

Viewing the crawl errors in Google Search Console
Viewing the clamber errors in Google Search Console

Google Search Console is one of the best SEO tools to monitor your website'south HTTP 5xx errors.

Causes of the 504 Gateway Timeout Mistake

As the 504 fault is due to a timeout between servers, the problem probably isn't with the client's device or internet connection. That also includes your device and connection.

A 504 Gateway Timeout error indicates that the web server is waiting too long to respond from another server and "timing out." At that place tin be many reasons for this timeout: the other server is not operation properly, overloaded, or down.

The other server need not always be external (eastward.chiliad. CDN, API gateway). It can also be a server-similar entity inside the chief spider web server (e.g. reverse proxy server, database server).

How to Fix the 504 Gateway Timeout Error

Without knowing exact details nigh the WordPress site, such as its server configuration, hosting plan, third-political party plugins, and the traffic it attracts, you may discover it frustrating and overwhelming to prepare a 504 Gateway Timeout error.

Since many variables are involved, I recommend you lot to start past fixing client-side issues, which are pretty rare, and and then motility towards fixing server-side problems. They're ordinarily the culprits with 504 errors.

Effort Reloading the Webpage

I of the first things you can attempt when encountering a 504 Gateway Timeout error is to expect a few minutes and try reloading the page.

You can press the F5 keyboard shortcut to refresh/reload the webpage in almost browsers. To remove the page's browser cache before reloading, you can press the CTRL+F5 shortcut combo instead.

Refreshing a webpage in Chrome browser
Refreshing a webpage in Chrome browser

While you're at it, you can also effort loading the site in a unlike browser to rule that out as an result. As virtually 504 errors are due to temporarily overloaded servers, using this solution should brand your site come right back.

If waiting and reloading the site doesn't gear up the 504 fault issue, you can cheque whether a site is down for everyone or just you lot. Two useful online tools to test a site for downtime are Down for Everyone or Just Me and Is It Down Right At present?

Testing Kinsta.com on Down for Everyone or Just Me
Testing Kinsta.com on Downwards for Everyone or Just Me

Reboot Your Network Devices

Sometimes, problems with your network devices like modem or router could lead to a 504 Gateway Timeout fault. Rebooting these devices could assist you with fixing the problem.

While you tin can switch off all these networking devices in any lodge, the order you switch them back on is important. Typically, turn these devices on from the "outside-in," following the connection order from the internet service provider to your main client device.

Check Your Proxy Settings

A proxy server sits between your device and the internet. Information technology's more often than not used to enhance online privacy past hiding individual information (e.g. device location) from websites and webservers (e.g. using a VPN).

While it's rare for proxy servers to cause a 504 error, incorrect proxy server settings tin can sometimes exist the reason. Yous can disable the proxy server and endeavor reloading the webpage to see whether information technology'll gear up the error.

Changing the 'Proxy' settings in Windows 10
Changing the 'Proxy' settings in Windows x

Most clients don't employ a proxy service, so you can skip this step if you're confident that you don't use any proxy server. However, you might take set it without yous even knowing about information technology. I'd propose you bank check your device's and browser's proxy settings to dominion this cause out.

DNS Issues

A 504 Gateway Timeout error can too be acquired by DNS issues on the server-side or the client-side (or both).

The about probable reason for a server-side DNS issue is the FQDN (fully qualified domain name) non resolving the correct IP address or the DNS server non responding. Usually, this occurs when you've but migrated your WordPress site to a new server or host. Hence, information technology's important to wait for the domain's DNS records to propagate fully, which can have upwards to 24 hours.

You can use gratis tools like whatsmydns.net DNS Checker or DNSMap to see if your DNS has propagated around the globe.

Checking DNS propagation for your domain on whatsmydns.net
Checking DNS propagation for your domain on whatsmydns.net

For fixing client-side DNS bug, you could try flushing your local DNS enshroud. It'due south similar clearing your browser cache, except hither, yous're flushing the DNS cache from the operating system.

If you're using Windows, y'all can flush the DNS cache by opening the Command Prompt and entering the following directive:

          ipconfig /flushdns        
Flushing the DNS Cache with Command Prompt
Flushing the DNS Cache with Control Prompt in Windows

You should encounter a "Successfully flushed the DNS resolver Cache." message if information technology worked.

For the latest macOS versions, you can open the Terminal and run the following command:

          sudo killall -HUP mDNSResponder        

Y'all won't see whatsoever notification in macOS when the process finishes, simply y'all can modify that by appending the command with your custom message.

          sudo killall -HUP mDNSResponder; DNS Cache was cleared successfully        

If you're using older macOS versions, the command you lot demand to enter varies based on which version of macOS you're running. For more details, yous can refer to the macOS section in Kinsta'due south in-depth affluent DNS tutorial.

If yous're using the Linux operating organisation, then the process is quite similar to macOS as fifty-fifty Linux uses the Terminal as its command-line interface. Since there are many Linux distributions, the exact control you need to run may vary from one distro to some other. You lot can check out Kinsta's guide for more than information.

Finally, yous can change your client-side DNS servers temporarily. By default, your Isp assigns the DNS servers automatically to you lot. But y'all tin change these to public DNS IPs temporarily.

Some reliable DNS servers you lot tin can endeavor out are Google Public DNS, Cloudflare 1.1.1.1, Quad9 DNS, and Cisco OpenDNS.

Settings custom DNS servers in Windows 10
Settings custom DNS servers in Windows 10

Disable Your Site's CDN Temporarily

Sometimes, the issue could also be with your content delivery network (CDN). If a site's origin server isn't reachable, most CDNs will endeavour to serve the full webpage from their cache.

But most CDNs don't enable this characteristic by default every bit information technology'due south complex to enshroud dynamic assets on most sites (east.one thousand. the WordPress admin dashboard).

Setting the 'Cache Everything' page rule in Cloudflare
Setting the 'Cache Everything' folio dominion in Cloudflare

A straightforward way to troubleshoot this is to disable your CDN temporarily. For example, if yous're using the free CDN Enabler WordPress plugin to link your site assets to the CDN URLs, so you can deactivate the plugin and test reloading your site.

The same goes for using any other plugin yous may utilize to connect to your CDN (e.thou. WP Rocket, Breeze, W3 Total Enshroud).

If y'all can't access your site's admin dashboard, you lot can disable the plugin via SFTP by renaming the plugin'southward folder name.

Disable all plugins via SFTP by renaming the plugins folder name
Disable all plugins via SFTP by renaming the plugins folder name

CDNs like Cloudflare or Sucuri, which provide total proxy services, have extra firewalls between their border servers and your origin server. Hence, yous may see HTTP 5xx errors more frequently while using them. Nigh of them cache 5xx errors returned by your origin server, and so it's easy to troubleshoot them.

Cloudflare's free plan is prone to throw up a 5xx error. Unfortunately, since it'due south a full proxy service, at that place'southward no quick way to disable information technology. But before you blame Cloudflare for it, know that Cloudflare shows 2 variations of the 504 Gateway Timeout error.

504 Gateway Timeout at Cloudflare (Variation one)

Cloudflare will show y'all a custom 504 Gateway Timeout fault screen when your site'southward origin server responds with a standard HTTP 504 response.

Cloudflare's custom Error 504 screen
Cloudflare's custom Error 504 screen

Hither, the consequence lies with your web server and not Cloudflare. You can attempt fixing information technology with the other solutions mentioned below or contact your hosting provider's back up for technical assist.

504 Gateway Timeout at Cloudflare (Variation 2)

If Cloudflare causes the 504 Gateway Timeout error, the fault screen will mention "cloudflare," which is currently the standard server proper name for all Cloudflare assets. Usually, the error screen will announced as beneath:

504 Gateway Timeout error caused by Cloudflare
Error screen for 504 Gateway Timeout caused by Cloudflare

Since Cloudflare itself is unresponsive, y'all'll not see any Cloudflare-branded error screen here.

Most probable, Cloudflare is already aware of the outcome and is working on a set up already. You can confirm this by checking the Cloudflare Organization Status webpage. Alternatively, y'all can get in bear upon with Cloudflare support for a quicker resolution.

Check Cloudflare System Status at cloudflarestatus.com
Bank check Cloudflare System Status at cloudflarestatus.com

504 Gateway Timeout at Cloudflare Due to Large Uploads

The size of your uploads to your site tin besides be a reason for the server timeouts. Cloudflare limits upload file size (per HTTP Mail request) to just 100 MB on both Free and Pro plans.

Cloudflare's 'Maximum Upload Size' limits for various plans
Cloudflare'south 'Maximum Upload Size' limits for various plans

The upshot can be on your host's end or with Cloudflare. You tin can notice out the exact cause by bypassing Cloudflare with your DNS hosts file and trying your upload again.

If y'all're using Cloudflare with WordPress, I recommend using their free plugin and excluding critical URLs from caching (such equally the WordPress admin dashboard). You can refer to Kinsta's detailed post on how to configure Cloudflare settings for WordPress.

Suggested reading: How to Set up up Cloudflare APO for WordPress.

Server Issues (Check With Your Host)

Server problems are one of the about common reasons for facing a 504 Gateway Timeout error. Since most WordPress sites are hosted on Nginx or Apache webservers, Nginx or Apache is waiting for a response from something and timing out.

Many clients come to Kinsta for exactly this trouble they're facing at other WordPress hosts. The conversation goes something like this:

We're getting around 100k visitors per month with more than than 200k views. Currently, we're hosting with ____ and nosotros experience 504 errors constantly due to server overload. I don't like how ____ handled the problem, and we were also brash that nosotros volition accept to move to their dedicated plans soon, which I believe is not necessary.

High-traffic and ecommerce sites are more prone to getting 504 errors considering of server overload every bit they generate many uncacheable requests. Even so, this issue can crop with whatever site, including simple blogs. Many hosts will inquire you to upgrade to a loftier-tier plan to fix the issue, which in most cases is unnecessary.

Subscribe Now

Kinsta uses LXD managed hosts and orchestrated LXC software containers for each site. Thus, every WordPress site is housed in its own isolated container with access to all the software required to run it (Linux, Nginx, PHP, MySQL). The resources are 100% private and aren't shared with any other site, even your sites.

Most WordPress hosts providing shared hosting plans don't have this capability. Hence, a high-traffic site hosted on the same server every bit yours may cause your site to throw upwards a 504 error as well.

Apart from isolating each site in its container, Kinsta has as well designed its infrastructure to handle thousands of concurrent connections easily. Kinsta even hosts the MySQL databases at localhost, not a remote server. This means no latency between machines, resulting in faster queries and fewer chances of timeouts occurring.

Many clients who migrate to Kinsta see huge decreases in overall load times.

A 212.5% increase in performance after switching to C2.
A 212.5% increase in functioning after switching to C2.

An overloaded server isn't the only cause for a server timeout. There can be many other reasons for the 504 fault:

Slow Server Infrastructure

The server you use to host your WordPress site may not have enough resource to handle the load. It's like playing a modern, graphics-intensive videogame on a decade-old PC.

The server merely hangs upwardly trying to serve the website. The merely solution to this trouble is to upgrade to a server with better infrastructure. For this reason, even Kinsta's most basic WordPress hosting plan will handle a static site with medium traffic.

Needs More PHP Workers

PHP workers are used to execute your WordPress site'due south code. An ecommerce site that gets l,000 visitors per month needs a lot more resources than a simple blog with the aforementioned amount of traffic. If all the server's PHP workers are busy, they'll build upwards a queue.

When the queue gets too big, the server disregards one-time requests, which may cause the server to throw up a 504 gateway error. Yous can ask your host about increasing your number of PHP workers. This'll allow your site to execute multiple requests simultaneously.

Firewall Issues

Your server'south firewall could take some errors or an improper configuration. Peradventure, a few of its rules forbid the server from establishing a connection properly. To know if your firewall is the culprit, you can cheque your server's fault logs.

Network Connectivity Problems

Connectivity issues between the proxy server and the web server could cause delays in responding to HTTP requests. If you utilise a load balancer, at that place could also be network connectivity issues with it.

HTTP Timeouts

HTTP timeouts can occur when a connexion betwixt the web server and the client is kept open up for too long. With WordPress sites, this commonly happens when running WordPress imports. I way to resolve this event is to switch to a faster internet connection.

Yous can also use a tool with support for WP-CLI to run the scripts straight on the server, bypassing the HTTP connection entirely. For instance, you tin use the wp import WP-CLI control to run the WordPress Importer plugin directly through the command-line interface.

Of import: 504 Gateway Timeout errors wait similar to 503 Service Unavailable errors or 502 Bad Gateway errors. Simply they're all dissimilar. If you're experiencing a 504 error at Kinsta, open a support ticket to get your issue fixed immediately.

For monitoring your site's downtime on your own, you can use a tool like updown.io. It'll check your website's status (or whatsoever URL) periodically by sending an HTTP request to it. You can gear up the cheque frequency from 15 seconds to 1 60 minutes. If your website isn't responding correctly, information technology'll notify you with an email or an SMS.

Monitor your website with updown.io
Monitor your website easily with updown.io

Yous'll get a generous quantity of free credits with every account of updown.io, but if you lot're looking for cheaper alternatives, yous tin bank check out WebGazer or UptimeRobot. Both these tools will help you lot monitor your site'south uptime every 5 minutes for free. That'south decent plenty for most website owners.

WebGazer website monitoring tool's dashboard
WebGazer website monitoring tool's dashboard

Monitoring your website will give you an idea of how often information technology's down. This is peculiarly helpful if you're using a shared hosting provider. Most managed WordPress hosts accept care of this automatically for you lot. Hence information technology'due south always recommended to get with them.

For a detailed explanation, check out Kinsta'due south post on the importance of managed WordPress hosting.

Spam, Bots, or DDoS Attacks

Malicious attackers tin can bring your web server to a crawl past sending too many and/or resource-intensive requests. If your site is getting spammed by bots or undergoing a DDoS attack, it tin can overwhelm your server and result in 504 Gateway Timeout errors for many 18-carat users.

You can look at your server traffic and analytics to see if you can spot whatever irregular patterns in the site traffic. If you're using Kinsta to host your site, y'all can view this data easily past going to your MyKinsta Analytics dashboard.

MyKinsta Analytics dashboard
MyKinsta Analytics dashboard

Start your investigation by looking at the top client IPs. It'll requite you an idea of who generates the maximum number of requests, and from where. If your server suddenly uses upwardly enormous bandwidth or attracts a lot of traffic, so this report will come in super handy.

Viewing 'Top Client IPs' in MyKinsta dashboard
Viewing 'Top Customer IPs' in MyKinsta dashboard

Side by side, you tin check out the Cache Analysis report. Here, yous can see how many requests are bypassing or missing the cache, or being served from the cache. For functioning and stability reasons, you lot desire to cache as many requests every bit possible, simply it's not always possible to achieve that.

For case, WooCommerce sites generate many uncacheable requests for features such as the shopping cart and the checkout process.

The 'Cache Analysis' screen in MyKinsta
The 'Cache Analysis' screen in MyKinsta

Finally, you lot can employ a WordPress security plugin to beef up your website's security by spotting and blocking worrisome traffic/IPs. You can ask your host to block sure IPs likewise.

Depending upon the length and calibration of the assail, this could be a never-catastrophe process of blacklisting IPs as many attackers alter their IPs and proxy addresses afterwards getting blocked.

Annotation: Kinsta doesn't let its clients to install WordPress security plugins as they tin can have a huge effect on the site'south performance, especially its scanning capabilities. As Kinsta uses load balancers with Google Cloud Platform, blocking IPs wouldn't e'er piece of work equally intended.

You tin use defended security solutions such equally Cloudflare or Sucuri to protect your sites from DDoS attacks and spambots. For more than, y'all can check out Kinsta'south articles on how to install Cloudflare on your WordPress site and how Sucuri helped stop a DDoS attack in its tracks.

Corrupted WordPress Database

Sometimes, a 504 Gateway Timeout error can exist because of a corrupt database, especially in WordPress sites. Typically, this is due to corrupted database tables or files. Sometimes, it tin can besides be caused past a serious security issue similar your site or database being hacked.

Repairing a corrupted WordPress database depends on the problem. Plugins like WP-DBManager make information technology piece of cake to diagnose database problems and repair them. I recommend you to read Kinsta'due south detailed walkthrough on repairing WordPress database issues to get started.

Bank check Your Site's Plugins and Themes

In most cases, tertiary-party plugins and themes don't crusade 504 errors. But there's a slight chance that they might cause server timeouts, usually by queuing upwards many uncached requests generated by the plugin/theme. As this ties up a lot of your server'southward PHP workers, it can cause 504 errors.

A great example of this issue is WooCommerce, a plugin installed to add together ecommerce functionality to WordPress sites.

The simplest mode you can troubleshoot this problem is past deactivating all your plugins. Remember, you won't lose whatever data if you simply deactivate a plugin.

If you lot can access your admin dashboard, yous can go to the Plugins screen, select Deactivate from the majority actions menu, checkmark all the plugins, and and then hitting the Apply button. This will disable all of your plugins.

Deactivate plugins in WordPress
Deactivating all the WordPress plugins through WP admin dashboard

If you can't access your admin area, you can disable plugins via SFTP using the method described before. Just rename the main plugin binder name to disable all the plugins in majority.

In one case you've deactivated all the plugins, bank check whether your site loads properly. If information technology works, you must activate each plugin, testing the site later on enabling every plugin.

Finally, make sure that your plugins, themes, and WordPress core are up to date. Likewise, ensure that your server is running the recommended version of PHP.

If you experience this to be besides overwhelming, you tin ever reach out to your host for help. Kinsta uses New Relic and other troubleshooting techniques to assist clients narrow down what plugin, query, or script might crusade the fault.

In the worst-instance scenarios, similar an inefficient query or bad code in a plugin/theme, y'all can bring in a WordPress programmer to fix the event.

Check Error Logs

Viewing error logs can exist very helpful when troubleshooting and debugging 504 errors on your WordPress site. This tin can assist you narrow down an issue on your site quickly, particularly if it'southward resulting from a enervating plugin on your site.

If you're a Kinsta client, y'all tin easily come across errors in the log viewer in your MyKinsta dashboard.

Checking error logs inside MyKinsta dashboard
Checking error logs inside the MyKinsta dashboard

If your host doesn't have a logging tool, then you tin enable WordPress debug mode by adding the following code to your wp-config.php file:

          ascertain( 'WP_DEBUG', true ); ascertain( 'WP_DEBUG_LOG', truthful ); define( 'WP_DEBUG_DISPLAY', false );        

The WP_DEBUG constant enables or disables the WordPress debug way. It has ii optional companion constants that can extend its features. The WP_DEBUG_LOG constant directs all errors to be saved to a debug.log file within the /wp-content/ directory. If yous don't run into this file, you can ever create 1.

The WP_DEBUG_DISPLAY constant controls whether debug logs show upwards on the HTML folio. Setting this to false will hide all errors, but y'all can review the errors later, equally you've as well defined WP_DEBUG_LOG as true.

Important: If you have WP_DEBUG enabled in the Kinsta surroundings, it'll road all errors to the debug.log file and non the error.log in the MyKinsta dashboard.

You can also download the raw WordPress mistake log files via SFTP. Typically, you can observe error logs in your server's root directory in a folder named "logs."

Accessing the WordPress error logs folder via SFTP
Accessing the WordPress fault logs folder via SFTP

Kinsta users tin besides enable WordPress debug mode from their MyKinsta dashboard. To practice that, navigate to Sites > Tools > WordPress Debugging and click the Enable button. This will allow you to run into PHP errors and notices without enabling debug mode via SSH or SFTP.

Lastly, you tin can check the server log files. Depending on which server yous're using to host your WordPress site, they're commonly found in these locations:

  • Apache: /var/log/apache2/error.log/
  • Nginx: /var/log/nginx/error.log/

You can refer to logging related documentation of Apache or Nginx for more information.

Configure Apache or Nginx Settings Properly

You lot can edit your server config files to increase resource limits for specific directives. This tin can assist you lot resolve the 504 Gateway Timeout error.

For Apache Webservers

Commencement, add the following code to your httpd.conf:

          TimeOut 600        

This setting defines how long the server will look for sure requests before marking it every bit a network timeout outcome. Its default value is 60 seconds (Apache two.4 version).

Y'all tin can only add this directive in your httpd.conf file, not in your .htaccess file. Since most shared hosting providers don't allow y'all to modify the httpd.conf file, you can effort increasing the value of the LimitRequestBody directive in your .htaccess file instead.

Then add together the following line to your php.ini file:

          max_execution_time 300        

The default value of PHP's max_execution_time directive is 30 seconds. Increasing it will allow your site'south PHP scripts to run longer.

For Nginx Webservers

If you're running your WordPress sites on Nginx + FastCGI Process Manager (PHP-FPM) or using Nginx equally a reverse proxy for Apache, you can tweak the server settings to help prevent 504 Gateway Timeout errors.

504 Gateway Timeout Fault on Nginx + FastCGI (PHP-FPM)

First, y'all must edit your PHP-FPM pool config file. You can find it at the /etc/php7.4/fpm/pool.d/www.conf location in your Nginx server (the exact path may vary based on the PHP version). Alternately, y'all can run the following command in your terminal to edit the PHP-FPM pool config file:

          sudo nano /etc/php/7.2/fpm/pool.d/world wide web.conf        

Adjacent, set the following directive:

          request_terminate_timeout = 300        

After this, yous must edit your php.ini file. Yous can locate it at /etc/php.ini. Open the file and add/modify the value for the max_execution_time directive to 300 seconds.

          max_execution_time = 300        

Finally, add together the following code to your nginx.conf file'southward location cake:

          location ~ .php$ { ... fastcgi_read_timeout 300; }        

Reload Nginx and PHP-FPM for the changes to have effect.

          sudo service nginx reload sudo service php7.iv-fpm reload        

The verbal code to reload PHP-FPM will vary based on the PHP version installed on your server. Test your site to see whether it has fixed the event.

504 Gateway Timeout Error on Nginx Proxy

If you're using Nginx as a reverse proxy server for Apache, and then y'all can brand information technology more lenient towards server timeouts by calculation the following directives to your nginx.conf file:

          proxy_connect_timeout 600; proxy_send_timeout 600; proxy_read_timeout 600; send_timeout 600;        

Don't forget to reload Nginx after making your changes.

sudo service nginx reload

Other HTTP Errors Like 504 Gateway Timeout

As mentioned before in the commodity, many other HTTP 5xx errors are just similar the 504 Gateway Timeout mistake. It'south because they all happen on the server-side. These errors include:

  • 500 Internal Server Error
  • 501 Not Implemented Error
  • 502 Bad Gateway Error
  • 503 Service Unavailable Mistake

Other HTTP errors caused due to client-side bug, similar the 404 Not Found mistake, are besides like the 504 error. You can refer to Kinsta's detailed guide and list of HTTP status codes for more information.

When y'all don't know what acquired a 504 Gateway Timeout fault, how do yous fix information technology in time to keep hard-earned visitors from bouncing to competitor sites? 🤷‍♂️ All the details are in this post. ⬆️ Click to Tweet

Summary

Your WordPress site can be affected by the 504 Gateway Timeout fault considering of multiple reasons. In this article, y'all learned how to troubleshoot them all. Typically, these errors are caused due to server-side bug, in which case you can accomplish out to your host and get it resolved speedily.

Even so, you must also sympathise that this error can exist due to third-political party plugins, themes, services, inefficient database queries, or a combination of 2 or more of these. If you're maxing out your server's resources (e.m. PHP workers), it'south recommended to optimize your site for operation.

If you still find that your website is timing out, then it might very well be that you demand to upgrade your hosting plan or the number of PHP workers. I recommend you to consider this option simply afterwards you've wearied all the other solutions described in this commodity.

From simple static sites to complex ecommerce and membership sites, Kinsta'due south scalable hosting plans are designed to adapt all types of websites. To learn more than about our scalable cloud hosting, check out this article!

Did we miss anything? If you're notwithstanding finding it difficult to fix the 504 Gateway Timeout error on your WordPress site, get out a comment below.


Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/seven.
  • Cloudflare Enterprise integration.
  • Global audience reach with 29 data centers worldwide.
  • Optimization with our born Application Performance Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a thirty-24-hour interval-money-back-guarantee. Check out our plans or talk to sales to find the program that's right for you.

crichtonhatichoode.blogspot.com

Source: https://kinsta.com/blog/504-gateway-timeout/

Post a Comment for "Apache Proxy Error Reading Status Line From Remote Server"