Ent access control sync error 502. Error "502 Bad Gateway" - what is it? Causes of appearance and solutions

Hello friends! Today we will talk about the 502 Bad Gateway error. I personally also get bored when I surf the Internet with a 502 Bad Gateway error. I myself did not know before what to do in such cases when I try to go to some address, now I know and share as always with you.


Basically this error appears for a number of some reasons such as DNS server, a proxy server, or the hosting provider on which the site is located is simply to blame for everything that does not open. This happens because the browser received an invalid response from the server, that is, from the provider where the site is located. Let's see what options to take.

  • Try entering a different website address in the address bar and go to it. As I said, everything should work and the error will disappear, but the site that does not open should open when the load on the server decreases. Did you understand? If another site opens, then just try opening it later.
  • Next, you need to make sure that you have an Internet connection, maybe you just need. And if you have an internet, but the sites still do not open, read on.
  • Another option is to clear cookies, you can do it like this…
  • - for IE 7+ in the menu: Tools - Internet Options - "Delete" button - "Delete cookies" button
    - for earlier versions of IE: menu Tools- Internet options - Delete cookies
    - for Firefox: Tools - Settings - Cookies - Clear cookies
    - for Opera: Tools - Delete personal data - Details.

If you have tried all the options and still does not help, then this means that the problem is outside your server and your computer. Perhaps a server has crashed somewhere and you will have to wait until the hosting administrator fixes it or when the site administrator solves this problem. Therefore, you can simply turn off the computer or minimize all windows and wait for a solution to this situation.

That's all friends! In this article, you learned what to do when 502 Bad Gateway appears in your browser. You can ask any questions in the comments. And in gratitude for my work, press the social buttons. Good luck to everyone!

Post navigation

502 Bad Gateway What is this error? There is an answer!: 6 comments

  1. Serg

    Pretty common mistake. Personally, I am quite lazy and always, when faced with it, I did not try to solve the problem, but always looked for other pages. Fortunately, the information on the Web is repeated. After reading this article, I realized that you can always achieve your goal for a short time. Thanks to the author for the description.

  2. Olesya

    Oops, this error is very common. just got it already. I never really understood this)) But all the less, now I will know what it means and how to deal with it)

  3. Igor

    I agree, it often occurs, it was curious to know its cause

  4. Svetlana

    Often and densely I encounter this error. Especially if the Internet suddenly disappears, then after it appears, the 502 error pops up almost everywhere. reload the page. It turns out that everything can be fixed. Many thanks to the author for this useful information.

Each Internet user has seen the message “502: Bad Gateway” in his browser, which means that an error has appeared on the web server side during the processing of the request. Most often, the causes of failures are associated with incorrect configuration of the web server or hosting company equipment. Standard problem is incorrect DNS or proxy processing.

What does "502: Bad Gateway" mean?

The error means that a request to the web server was received from the browser, but was incorrectly processed or removed from the general queue. If the server is programmatically located behind the Internet gateway, then the problem is likely in the gateway or in the operation of the web server itself, which transmits error information to the gateway, and it is then displayed in the user's browser.

Causes of occurrence Lack of server resources

The main problem with this error is the insufficient level of server resources to process incoming requests, which causes the server to start generating a 502 error. The lack of resources can be both hardware (lack of random access memory, insufficient speed of the processor or disk), and software related to incorrect configuration of the server or the software used.

But there is a situation when, with a sufficient level of resources, the server continues to periodically generate an error 502: Bad Gateway. What could it be if not hardware failures?

The resource limit can be entered automatically when the selected resource exits. VPS servers or shared hosting outside tariff plan. As a result, the server may not be able to handle the current load.

Web servers such as Apache have a strictly defined number of request handlers that are set when it is configured. If all of them are busy at the same time, the incoming request is placed in the queue, and its time cannot exceed a minute for each of them. If the timeout is exceeded, the processing of the request is canceled and a 502 error is issued to the user. In addition, the handler may simply not have enough current free resources to process the queue normally.

In the case of using the PHP + FastCGI software bundle on the server, with an unoptimized amount php-cgi processes almost always there are overloads and shortages of resources.

The most common causes of insufficient resources to process requests

  1. The server cannot cope with the current number of concurrent visitors to the site. Also, various and incorrect software scripts can consume a significant part of the resources.
  2. Server overload during hacker DDos attacks, when the server is brought to failure by a large number of simultaneous requests for processing.
  3. There is a situation when, when using the service, an error 502: Bad Gateway unexpectedly occurs. What does it mean? This may indicate a problem on the hosting side, known as overselling, i.e. hosting so many client accounts on one server that at times of peak load they do not have enough current hardware resources.
  4. Incorrect configuration of the server itself or lack of software or hardware compatibility.
  5. The use of connected external resources on the site, such as hit counters, various informers, scripts. An error can occur if there are problems with such external sources.
  6. File upload big size to the server if the quality of the Internet connection is poor.

PHP script errors

Error 502 can occur due to PHP scripts, plugins or extensions that do not pass the appropriate code to the server when they complete their execution. For example, an error 502: Bad Gateway nginx as one of the proxy server options can be generated due to incorrect detection of the script state and perception of a broken connection with the web server services as a system failure.

So, all static information (pictures, site pages, Robots files) loads normally and without errors. What does "502: Bad Gateway" mean in this case? That the failure occurs precisely when loading software scripts, plugins and extensions.

Measures to resolve error 502

First of all, it is necessary to analyze the current server load, especially when an error occurs. Particular attention should be paid to the load of RAM and, if necessary, increase its size to improve the processing of requests.

Check if the limits on the number of simultaneously processed php-cgi processes are set correctly. Their misconfiguration leads to a rapid overload of the service and the constant occurrence of the message "502: Bad Gateway". What is it and how to set process limits correctly, ask the hosting provider's support service.

Minimize requests to external network resources and set a time limit for downloading and responding to them. This will allow you to see what server resources are spent on, and will help get rid of the external “slipping” of the site.

In case of suspicion of overselling or wrong setting server configuration, contact the hosting support service. If there is no response and the problem persists, change your hosting provider. Server unavailability can lead to losses due to a simple error 502: Bad Gateway. What this means for business, I think, is not worth explaining.


- This is the result of processing the request, indicating that there are problems on the site. Rarely enough, the problem is on the client side, but it happens. Most often, the reason is an incorrectly configured site, a problem with hosting, and failures in the hoster's equipment. One of the problems is the wrong DNS or proxy server address.

Error 502: what does it mean?

Error 502, which means server failure, is quite common. It is likely that the site does not have enough system resources to process the request, there are problems in the code, Apache is not configured correctly, the DNS address is incorrect, etc.

Error 502 bad gateway indicates that a request from the client came to the server, but due to systemic problems resource, no response. It is considered normal when a request is sent to the server and it queues up for processing. In the case where the server is located behind a gateway, it is likely that Apache or the gateway has failures or problems in operation.

In addition to server configuration issues, 502 errors are often the result of limited resources. After the power is exhausted, users become hostages of failures. Highly loaded resources rarely experience problems of this nature, since the power is calculated with a margin. Rather, the problem is in a DDOS attack, which loads the server, leaving no room for the user.

Error 502: how to fix?

Perhaps the only way to fix the 502 bad gateway error on the client side is to clear all the settings and temporary files that are stored in the browser. You should first check if there are any failures in the browser in general by going to several other sites. Then check if the problem occurs in another browser.

In some cases, not one site, but a whole hosting is laid down, then you should check the performance of resources from other regions / countries. Clearing cookies allows you to get rid of various problems with a browser. In general, the cleaning algorithm has the following form:

  1. Launch browser Google Chrome;
  2. Click on the "Menu", looks like three longitudinal stripes or dots and go to "Settings";

  1. In the column "Personal data" click on "Clear history";

  1. Set the duration of cleaning "For all time" and check the boxes next to the first 4 items;
  2. Click "Clear History".

The variant for other browsers differs in execution, but only slightly. You can use the common keyboard shortcut Ctrl + Shift + Del.

Clear the cache of all installed browsers at once and Windows applications possible with the help CCleaner programs. There is a search for all temporary files and their subsequent removal.

Perhaps this is the only effective way to resolve the problem on the part of the client. If there is no solution, you should notify the resource administrator about the problem.

Error 502 bad gateway: other causes

The 502 gateway error is more scary for owners of their own facilities. For owners of sites that are hosted on a hosting, you can contact technical support. They will report the exact cause of the failures, in general there may be the following problems:

  1. Exceeding the maximum capacity allocated for the resource. So, if the machine is capable of withstanding 10,000 requests per second, then any excess of this number is fraught with an error. Typically, multiple sites are hosted on the same hardware. Poor-quality provision of services by hosting, even within the allowable load norms of a dedicated server, can knock out 502 errors;

  1. The server configuration has some limitations or glitches. It is necessary to check the correctness of the exposed load. Highly loaded resources have their own structural features, gateway and server settings. The load on the server should be reduced as much as possible;
  2. DDOS attack. Attacks on resources are usually carried out in order to extort funds for stopping DDOS and further "protection". The alternative is an attack from competitors. It is necessary to organize special protection, a firewall is installed, which certainly requires a lot of effort to organize, but allows you to secure the server. It is important that 100% protection cannot be achieved, any resource can be put, but the load threshold increases significantly, most likely DDOS becomes unprofitable and stops;

  1. Problem with PHP code. This situation is more inherent in the site owner himself, although technical support can help with solving the problem. It is important to use algorithms with a minimum level of load. Eliminate the possibility of infinite loops, partially shift the processing to JavaScript, which is executed by the client. Make sure there are no bugs in the code or deprecated functions.

In the admin panel, you should temporarily disable or, on the contrary, enable FastCGI.

From the user's side, you can perform several additional procedures - check the presence of active Internet protection in the antivirus. You should temporarily suspend the antivirus and go to the address to the site.

The browser or Windows should not be using a proxy or VPN, check the list of running tasks and extensions. Perhaps the server does not respond to some intermediate value in the proxy space.

Coordinate the actions of the user, the administrator of the resource will help technical support hosting. For the capacity owners themselves, you should check the log file and analyze the cause of the failures.

If you still have questions on the topic “What does the 502 bad gateway error mean and how to fix it? “, you can ask them in the comments


if(function_exists("the_ratings")) ( the_ratings(); ) ?>

We are accustomed to the availability of sites on the Internet, and when something is not available, it is sad. Mistake 502 Bad Gateway occurs when you try to visit a web page. You send a request to the server where the site is located, and it sends an error in response. Almost always the cause is on the side of the site, but sometimes there are problems on your computer or network equipment. Here's what you can try to fix it.

What is a 502 Bad Gateway error?

Mistake 502 Bad Gateway means that the web server you connected to is acting as a proxy for information from another server, but it received a bad response from that other server. It's called a mistake 502 , is the HTTP status code used to describe the error. Such responses can be caused by a number of different reasons: the server is overloaded, network problems between two servers. It is also possible that there is a misconfigured firewall, or even a coding error, and the problem will not be fixed until these issues are fixed.

As with mistakes 404 , website designers can customize how the error is displayed 502 . So you can see different 502 pages. Websites can also use several different error names.

For example:

  • Mistake HTTP 502 Bad Gateway
  • HTTP 502
  • 502 Temporary Service Overload
  • temporary error ( 502 )
  • 502 Server Error: The server encountered a temporary error and was unable to complete the request
  • 502 Bad Gateway Nginx

What can you try to fix on the computer.

Great browser extension for chromium. detects error codes 404, 408, 410, 451, 500, 502, 503, 504, 509, 520, 521, 523, 524, 525 And 526 and checks if archived versions of the requested URLs are available. If they are, a message will appear with the option to view the archived version. Works on site archive.org.

Refresh the page

Refreshing the page is something to try for any error. Often the 502 error is temporary and a simple refresh can get you to the site. Most browsers use the key F5 to update, and also provide a "Refresh" button somewhere in the address bar.

Check website availability in the world

In Russia, there is no access to many sites, even if they are not on the block list, they may have been included in the list of IP addresses that falls into the Telegram block list. How to deal with this, I told in this

Here are two services I use to see if a site is available

isitdownrightnow.com downforeveryoneorjustme.com

Both work pretty much the same. Enter the URL you want to test and get the result. If U.P., then the site is available.

If the site is not available to everyone, then there is no point in continuing to look for the cause on your computer. Otherwise, read on.

Try another browser

There may be a problem with the browser that is causing the error 502 Bad Gateway. An easy way to check this is to use a different browser. you can use Google Chrome, Mozilla Firefox , Apple Safari or Microsoft Edge. The easiest way is to run Edge on Windows, it is preinstalled and if you do not use it by default.

Clear browser cache and cookies

The second most common way to fix a broken site, or anything in the web space, is to clear the CACHE! Your main browser may have cached outdated or corrupted files, which may cause an error 502 .

Enter this line chrome://settings/clearBrowserData in Google Browser Chrome or find the corresponding item in the settings. Check the checkboxes next to the deletion items.

Checking plugins and extensions

If you are using extensions in your browser, it is possible that one or more extensions are causing the problem. Try disabling all your extensions and then accessing the website. If after that the error disappears, then for sure the extension. Enable the plugin one by one to find the culprit.

Reboot Devices

If all of the above steps did not help, the only thing left is to restart the computer and the router. If after that nothing works, then it remains only to wait.

Liked the article? Share with friends: