💻 What does error 502 bad gateway: the causes, ways of solution

Error 502 may be locked browse the web resource

CONTENT

  • 1 What means the error 502 bad gateway
  • 2 Source of the problem
  • 3 What can be done to the user when an error occurs
  • 4 What can be done to the site owner

What means the error 502 badgateway

Like all errors on your PC, the problem is the English name, which is a literal translation from the original sounds "bad gateway". This means that the appearance of this message is not necessary to assume the presence of viruses.

This situation occurs when the browser refuses to display the desired page and returns an error to the user, indicates that the request passed from the client PC to the recipient server, but due to various reasons, not completed receiving a response from the back side.

When typing in the address bar of the browser accesses the server data exchange

The normal situation is the transfer request to the incoming server with the production of it in the queue for processing. But at the same time you do not see a system failure, but simply waiting for a connection occurs. If the server is immediately after the gateway, it is likely that it works correctly.

Between the computer, the client and the source gateway necessarily present in the role of which in the simplest scheme, the router acts

Generally speaking, all the errors of the form 5XX indicate a problem on the server side, accessed by the user appeal. And, as practice shows, the inscription «error» occurs most often after repeated users access to a particular resource.

Excess request time causes connection loss

Source of the problem

Understanding the nature of the problem does not answer the question of why it can occur. There are several common reasons for which the user sees an error code.

Lack of resources to handle the request

One of the main reasons leading to the absence of the compound is the insufficient capacity of the server to which the request is addressed. For example, if the machine on which the resource is placed, can only handle 5000 queries per second, when set number fails. As a rule, on the same equipment can be placed a few sites. But the owners carefully watch their own "iron", the reason why there is a lack of resources due to fraud or poor quality provider of hosting services.

DDoS-attack

Kind of hacker attack, the purpose of which is to bring the system to failure. In fact, the reason for this is similar to the previous one, but in this case it is provoked artificially.

When a DDoS attack is a "bombing" the computer-victim numerous requests

Meaning DOS-attack is pre-infection of a large number of computers becoming bots from which at a certain moment Time begins to generate requests to the selected site either directly or through a chain of proxy servers, resulting in a loss of efficiency that resource. Most often, this method is elected by unscrupulous competitors who want to stop the operation of the site.

TONOTICE! (Click to see)

TONOTICE!

Implementation of measures to improve the site does not guarantee 100% success rate, but with each new load increase threshold reduces the effectiveness of attacks, leading to their inappropriate.

This type of hacker attack uses infected computers that can be located all over the world

Problems with PHP-code

The situation which is more about the owner of the site, and is expressed in the wrong configuration source code. When writing the "body" of the resource necessary to optimize its performance as much as possible, including the algorithms that minimize the load level. To exclude an infinite loop, their performance can shift to the Java scripts. Additionally, before you start your own website, it is not superfluous to check the operation in different situations, isolating deprecated features and optimizing the source code.

Optimized code - site warranty performance

What can be done to the user when an error occurs

Despite the fact that the error indicates a problem by itself a resource, to which the appeal is addressed user, to exclude the possibility of other causes, the latter may take a number of actions that could help to solve Problems.

Check another site of operation

The first thing to determine that there is no response from the requested resource it should go to another site, known to work. For example, if a user accesses the "contact" and "Classmates" and see an error message that can be recommended in the browser to open a federal news portal. When you receive free access to the selected resource, simply wait for the completion of the technical work on the restoration of access.

As a test may be advisable to visit federal sites

TONOTICE! (Click to see)

TONOTICE!

This rule works only for the global Internet. If an error occurs on a computer located in a LAN, you should contact the administrator, because the system is unable to carry out a full diagnosis.

Launch browser in incognito mode

The next step, which can be taken when an error occurs with the inability to connect to the site, is to run the browser in "incognito" mode. This means that the browser will be launched in its original form, without any add-ins, add-ons and various extensions.

The transition to the private browsing mode or Incognito will disable all browser add-ons

Enable this mode is possible in any browser

Can activate the active mode by pressing the appropriate key combination:

  • Ctrl + Shift + n - to run incognita in chromium Yandex, Opera or Safari;
  • Ctrl + Shift + p - to activate the mode in Firefox, IE, or Microsoft Edge.

If running your browser in such a connection is established without any problems, you should return browser settings in a state of "default", since the problem may be hiding in the settings or extensions.

clean cookies

Cookies - a tool that is used by the browser to save the "fingerprint" of visited pages, which allows, when re-open them, display speed up the process. But long-term use of the internet collects a large number of "cookies", which slows down the browser or can be the cause of connection problems.

To delete a saved page you can take advantage of specialized programs

TONOTICE! (Click to see)

TONOTICE!

It may be noted that the algorithm for removing cookies is almost identical for all types of browsers, but there are some differences in the access to the settings.

InternetExplorer

To delete the browser history you want to go to the settings menu, which is located below the icon in the form of gears, located in the upper right corner of the screen. Next, you must go to the "Security" section and activate the option "Delete history".

Call up the menu with access to the settings, you can delete the whole story

The user will see a dialog box where it will be offered to erase unwanted elements more and select the period for which will Delete history. After putting ticks in the checkboxes, you can confirm the action by pressing the "Delete" button.

Chrome

The algorithm is almost the same. The first thing you want to go to the settings. To do this, click on the icon with three horizontal bars in the upper right corner. select "Settings", select the drop-down menu.

Chrome makes it possible to select multiple parameters when deleting history

Next, you must scroll through the list and get to the "Clear History" button. In the menu that will offer the user to choose the desired deletion settings: define the time period for which you want to delete the history, mark items designed to erase. Pressing the "Clear History" button is the final action will be.

Opera

This browser to access the settings menu required tapnut logo on the browser, which is located in the upper left corner. Or you can use the keyboard shortcut Ctrl + H. From the drop-down list, the user will need to select "History".

The set of options available after clearing the history, the same for all browsers

In the window that will display all visited sites, as well as a button "Delete browsing history ..." After pressing it, you can select the necessary items to remove, as well as the time period for which you want to clean up its activities in the browser.

Firefox

Everything is similar. By pressing on the three horizontal lines in the upper right corner to open the drop-down menu, where there is the item "Settings". Followed go to the tab "Privacy". The user will be prompted to delete a large number of options, but, if necessary, the cookies have clean, need to select the "Delete selected" cookies. "

In Mozilla to remove cookies need to go to the "Privacy" section

In the window that will display all the stored cookies-files. You can remove them all by clicking on the appropriate button, or select individual.

TONOTICE! (Click to see)

TONOTICE!

Custom mode is useful if the user knows exactly what "cookies" are problematic resource. Otherwise it is better to choose the option "Delete all".

Yandex. Browser

Everything is simple and clear. Selected stylized sandwich of three strips, which is located in the upper right corner. Further, the need to go to the "History" tab, where it is possible to remove the problem, user, web view. If you need to conduct a thorough cleaning, with the choice of time period and certain items, then you must go to the "Extras".

TONOTICE! (Click to see)

TONOTICE!

Virtually all observers cleaning works on the history of keyboard shortcuts Ctrl + Shift + Del, causing a transition to the settings menu to the desired parameter.

In Yandex can immediately delete the whole history with a single click

Deleting your cache DNS

Cache DNS - this store IP-addresses of all the sites that the user visits. This is another measure by which manages to speed up page loading with repeated reference to it. But, if there are problems with the connection, there is a possibility that the amount of data saved obsolete. In this case, you want to be cleaned:

  • call the command line key combination Win + R (administrator rights are required);
  • type the command cmd;
  • enter the command ipconfig / flushdns;
  • press Enter;
  • after a while the system will notify the end of the process of inscription on the successful cleaning the cache.

Removing IP address cache by a special team

What can be done to the site owner

On frequent appearance of the corresponding error when opening the resource, experts give a few recommendations for site owners to follow which will help prevent problems from occurring in the future:

  • should conduct load analysis, which maintains the server when normal operation and during its fall. This action helps to find out how, RAM is loaded. At its shortage, need only add a few bars;
  • at too frequent occurrence of errors is required to validate billing limits on the number of php-cgi processes. Incorrect setting of this parameter can cause a crash when accessing the server;
  • It can be recommended to try to reduce the number of requests to external sources. Additionally, there is no excess exposure time limit for waiting for a response and page load;
  • using a virtual machine using common server drops the first step is to try to change the service provider, as is likely, the problem arises from his side.

Specialized network monitoring system allows the site owner to identify any weaknesses

Understanding the causes of error 502 bad gateway helps to find a way to restore normal operation. As practice shows, the user just need to be patient and wait for access. The owners of the resources with the appearance of this problem, look at the modernization of the equipment or to the quality of the service provider. More time to understand the ways of solving the trouble can be presented.