什么是504网关错误,如何修复?

504不适合企业网关超时错误s. They mean your site isn’t loading and that doesn’t just hurt visits and sales, it can impact SEO, too. The solution? There are quick and simple fixes, and where those fail more complex remedies.

In this blog, I’ll unpack what you need to know about 504 Gateway Timeout Errors. We’ll look at what they are, their causes, and how to diagnose them.


什么是504网关错误,您如何修复它?:


What is a 504 Gateway Timeout Error?

网站用户互动基于一个非常简单的公式。您在地址栏中键入域或单击链接和站点加载。在更精细的层面上,现场访问涉及更多。当您启动网站访问时,您的浏览器会向托管要访问的网站的服务器发送请求。

504网关超时错误是一条消息,当站点无法加载服务器到服务器通信问题时出现。


What Causes a 504 Gateway Timeout Error?

504 gateway errors are a result of a delay in server-to-server communication. When a request is made to visit a site, it moves from one webserver to another. The request is sent upstream to the server that hosts the website. When the upstream server takes too long to respond, the downstream server presents the 504 error message.

It’s important to note that while 504 errors involve user devices, user devices are rarely the reason for the error unless the device doesn’t have an internet connection or has an unstable one.

504 Gateway超时错误通常也与上游服务器无法处理的网络流量的涌入有关。当它们被超载时,它们会崩溃。服务器还可以遭受其他疾病,以防止它们发挥最佳功能,从而呈现504个错误。


The Class of 500 Errors

504 Gateway超时错误是11个,属于5xx状态代码类。这些包括:

1. 500 Internal Server Error

500内部服务器错误响应是通用错误代码。它是无法分配到特定问题的错误代码的占位符。

2. 501 Not Implemented

501 responses show when a server doesn't fulfill a request or can’t recognize the method through which the request is sent.

3. 502 Bad Gateway

当用作代理服务器或网关从上游服务器接收无效的答复时,使用502个不良网关错误代码。

4. 503服务不可用

503“服务器不可用”错误是由于超载或计划的维护。

5. 505不支持HTTP版本

当服务器不支持用于查找网站的HTTP协议版本时,发生505个错误。

6. 506变体也谈判(RFC 2295)

当transpar 506错误发生ent content negotiation for a request results in circular references. The request causes a loop that returns the error.

7. 507存储不足(WebDav; RFC 4918)

507错误是服务器端未能存储完成请求所需的表示形式的结果,507的存储响应结果不足。这可能与服务器上的低磁盘空间或RAM有关。在WordPress网站上,此错误可能是由于需要更新的插件。

8.检测到508循环(WebDav; RFC 5842)

508 Loop Detected errors mean a server has encountered an immeasurable loop while handling your request.

9. 510不扩展(RFC 2774)

当服务器需要其他扩展返回请求时,将出现510错误响应。

10. 511 Network Authentication Required (RFC 6585)

511错误代码与身份验证有关。这表明需要客户证明身份验证才能访问站点。


The Many Faces of the 504 Gateway Error

504 gateway errors often appear with different names given the variety of browsers and operating systems, server and server software available today. It’s possible that you may have seen one of the following:

“504网关超时”

“错误504”

“NGINX 504 Gateway Timeout”

“504 Gateway Timeout NGINX”

“网关超时错误”


How 504 Gateway Timeout Errors Influence SEO

SEO is about optimizing websitesand web pages to return content that best answers a user’s question. And because 504 Gateway Timeout Errors cause downtime, they can negatively influence your SEO rankings.

When 504 errors occur, search engine spiders that constantly scour the net can’t get to your site. To spiders, your site appears to no longer be available. Most 504 errors are temporary and therefore have very little to no impact on a网站的SEO。这些案例还使用您的网站中的缓存页面处理,因此人们仍然可以访问信息。但是在可怕的情况下,站点停止了6个以上或更长时间,您的SEO将受到打击。


How do I Fix a 504 Gateway Error?

504错误通常是短暂的。在我们深入研究更复杂的504错误修复之前,从轻松工作开始是一个好主意。修复程序?首先,刷新您的浏览器。使用F5按钮确保服务器端刷新,而不会进行缓存刷新。如果您收到相同的错误,请尝试访问其他站点以确保它不是您的互联网连接。

Try using mobile data. Your Internet Service Provider can be the reason for connectivity issues. To test yours, log off your WiFi and try and visit your site using mobile data.

Rebooting your modem and other network devices like repeaters is also a good idea. These sometimes can be responsible for poor internet connectivity. If your network devices aren't the problem, it’s time to dig deeper.

鉴于504个错误主要是服务器端问题,我将介绍您可以使用的基本逐步故障排除框架。它将涵盖连接性,DNS Gremlins,仔细检查服务器日志和防火墙配置以及网站错误。

让我们开始吧。

Is your server down?

Today, it’s not uncommon for a site to live on more than one server. And when 504 errors occur, they can be a temporary issue. To figure out whether your site is down due to a server outage, visit your hosting provider’s site. Typically, hosting providers show server statuses and you’ll be able to tell if yours is down and why.


Has your DNS recently changed?

DNS更改意味着您的网站从一台服务器移至另一台服务器。虽然很少有一家托管公司在没有适当的计划或通知的情况下采取这样的举动,但可能会发生。另一个与DNS相关的案例可能是您所做的更改。

DNS更新(与网页更新不同,请花费时间。通常,您必须等待24至48小时才能传播并提供。


您的日志显示什么?

Server logs are a play-by-play record of all activities that take place on your site. They include web page visits, IP addresses of visitors, types of devices they use, pages that referred a visitor, and a code if a web page was not found.

Combing through server logs may not sound like fun, but can be helpful. For example, they can show any sudden spikes in web traffic and where it’s coming from, something that could help you better manage traffic flow and ease the burden on your site and server.


您的防火墙配置是否改变了?

Firewalls act as your website’s line of defense. And while sophisticated, they still require human interaction to manage updates to firmware and software. It does, on occasion, happen that buddy updates wipe previous settings. When you review your firewall, you should be able to review updates applied, and if need be, roll back your last firewall profile.


越野车网站?

Sifting through website code to spot errors sounds painful, but it’s necessary. To get to your code, you’ll need to FTP to your site using a client.


It’s likely not your CDN

While it may be considered, CDNs are seldom the reason for a 504 Error. As you can see in the image below, this example from Cloud flare shows that the broken link is the web server hosting the site.

在极少数情况下,它是云耀斑 - 相关的中断,您会看到以下情况:

CDN团队通常反应迅速,并在此问题上努力。如果您想检查它,请访问CDN提供商的网站以获取网络状态更新。


Final Words: Start With The Easy Stuff

504 Gateway超时错误并不有趣,但是很有可能您不需要进行任何繁重的举重就可以看到您的网站重新栩栩如生。从简单的浏览器刷新开始。如果不起作用,请前往您的托管和CDN提供商网站进行网络状态更新。如果这些似乎不是原因,那就更深入地挖掘。

Over 30.000 marketing professionals rely on us for their news. Shouldn’t you?

Subscribe to the world’s #1 influencer marketing newsletter, delivered bi-weekly on a Thursday.

Baidu