However, when an error occurs the browser returns the error code to inform the user of what has happened. These HTTP status codes are divided into five types according to their function or origin. Thus, 1xx codes are for informational purposes only the 2xx indicate that the request occurred correctly HTTP 3xx codes address redirects the errors 4xx refer to customer errors occur and 5xx server errors.
HTTP 5xx status code: server errors
Errors headed by a "5" have to do with failures that occur in the server and that prevent a web from loading properly. Typically, this type of errors occur due to problems in the content of the web for example, the use of images that are too heavy. In any case, the HTTP status code itself will tell you where the problem that caused the error on the server is.
Most common 5xx errors
- 500. Internal server error. Generally, an error 500 is related to errors in the code that prevent the web from being used correctly although it may also be because it is not possible to specify the error. If your website returns an error 500, check the error log to find more information and solve the bug.
- 502. Incorrect gateway. A server is nothing more than a link between a browser and the content stored on the server. Therefore, if there is no agreement in the communication protocol, an error 502 will be returned. Generally, error 502 is the consequence of a bad connection of the hosting provider or an overload of the service.
- 503. Service not available. When for maintenance tasks or as a consequence of an overload the server is not available. If your website returns an error 503 contact your web hosting provider to check if for example it is being updated. In the event that the server error occurs as a result of an overload you will have to assess the possibility of extending the service so that these types of server failures stop occurring.
- 504. Server time has run out. Errors 504 occur when the estimated time to respond to a request is exhausted without it being possible to offer a result. This server error means that the communication between the browser and the server is being too slow. To solve an error 504 it will be necessary to review in addition to the functioning of the server, the content of the web. The most probable thing is that the web weighs too much to be able to be loaded in the estimated time or that has an excess of information that increases the download time.
If many of the 5xx errors that occur are related to a bad configuration of the web there are others that occur as a result of the lack of server update or lack of resources.
- 505. HTTP version not supported. Sometimes, it is possible the browser and the server are using different versions of a protocol hence there are incompatibilities between both. To avoid this it will be necessary to update the server so that it uses the same version of the protocol as the browser. In addition updating the server also improves its security.
- 507. Insufficient storage. When a server does not have enough free memory an error 507 will appear. This can be solved in two ways: eliminating obsolete content from the server or increasing its resources .
- 509. Broadband limit exceeded. Just as the server memory may run out the same can happen with bandwidth . Some web hosting plans have an assigned broadband limit that when exceeded will cause the server to fail.