• Is a New iPad Pro Coming Soon?
  • Get It Now: Spring Tech Deals at Amazon

502 Bad Gateway Error: What It Is and How to Fix It

This error is usually caused by two different internet servers that are having trouble communicating

safari bad gateway 502

  • Emporia State University

safari bad gateway 502

In This Article

Jump to a Section

What Does a 502 Bad Gateway Error Look Like?

What causes a 502 bad gateway error, how to fix a 502 bad gateway error.

  • Frequently Asked Questions

The 502 Bad Gateway error is an HTTP status code that means that one server on the internet received an invalid response from another server. These errors are completely independent of your particular setup, meaning that you could see one in any browser, on any operating system, and on any device.

The 502 Bad Gateway error displays inside the internet browser window, just like web pages do.

Each website can customize the 502 Bad Gateway. While it's fairly uncommon, different web servers do describe this error differently .

Below are some common ways you might see it:

  • 502 Bad Gateway
  • 502 Service Temporarily Overloaded
  • Temporary Error (502)
  • 502 Proxy Error
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • 502. That's an error
  • Bad Gateway: The proxy server received an invalid response from an upstream server
  • HTTP Error 502 - Bad Gateway

A Bad Gateway error received in Windows Update generates a 0x80244021 error code or the message WU_E_PT_HTTP_STATUS_BAD_GATEWAY.

When Google services, like Google Search or Gmail, are experiencing a 502 Bad Gateway, they often show Server Error , or sometimes just 502 , on the screen.

Bad Gateway errors are often caused by issues between online servers that you have no control over. However, sometimes, there is no real issue but your browser thinks there's one thanks to a problem with your browser, an issue with your home networking equipment, or some other in-your-control reason.

Microsoft IIS web servers often give more information about the cause of a particular 502 Bad Gateway error by adding an extra digit after the 502 , as in HTTP Error 502.3 - Web server received an invalid response while acting as a gateway or proxy , which means Bad Gateway: Forwarder Connection Error (ARR) .

An HTTP Error 502.1 - Bad Gateway error refers to a CGI application timeout problem and is better to troubleshoot as a 504 Gateway Timeout issue.

The 502 Bad Gateway error is often a network error between servers on the internet, meaning the problem wouldn't be with your computer or internet connection.

However, since it is possible that there's something wrong on your end, here are some fixes to try:

Try loading the URL again by pressing F5 or Ctrl+R ( Command+R on a Mac) on your keyboard, or by selecting the refresh/reload button.

While the 502 Bad Gateway error is usually indicating a networking error outside of your control, it could be extremely temporary. Trying the page again will often be successful.

Start a new browser session by closing all open browser windows and then opening a new one. Then try opening the web page again.

It's possible that the 502 error you received was due to an issue on your computer that occurred sometime during this use of your browser. A simple restart of the browser program itself could solve the problem.

Clear your browser's cache . Outdated or corrupted files that are being stored by your browser could be causing 502 Bad Gateway issues.

Removing those cached files and trying the page again will solve the problem if this is the cause.

Delete your browser's cookies . For similar reasons as mentioned above with cached files, clearing stored cookies could fix a 502 error.

If you'd rather not clear all of your cookies, you could first try removing only those cookies related to the site you're getting the 502 error on. It's best to remove them all but it won't hurt to try the clearly applicable one(s) first.

Start your browser in Safe Mode: We have instructions for Firefox , Chrome , or Edge . Running a browser in Safe Mode means to run it with default settings and without add-ons or extensions, including toolbars.

If the 502 error no longer appears when running your browser in Safe Mode, you know that some browser extension or setting is the cause of the problem. Return your browser settings to default and/or selectively disable browser extensions to find the root cause and permanently fix the problem.

A browser's Safe Mode is similar in idea to the Safe Mode in Windows but it's not the same thing. You do not need to start Windows in Safe Mode to run any browser in its particular "Safe Mode."

Try another browser. Popular browsers include Firefox, Chrome, Edge, Opera, and Safari.

If an alternative browser doesn't produce a 502 Bad Gateway error, you now know that your original browser is the source of the problem. Assuming you've followed the above troubleshooting advice, now would be the time to reinstall your browser and see if that corrects the problem.

Restart your computer . Some temporary issues with your computer and how it's connecting to your network could be causing 502 errors, especially if you're seeing the error on more than one website. In these cases, a restart would help.

Restart your networking equipment . Issues with your modem, router, switches , or other networking devices could be causing 502 Bad Gateway or other 502 errors. A simple restart of these devices could help.

The order you turn off these devices isn't particularly important, but be sure to turn them back on from the outside in . Check out that link above for more detailed help on restarting your equipment if you need it.

Change your DNS servers , either on your router or on your computer or device. Some Bad Gateway errors are caused by temporary issues with DNS servers.

Unless you've previously changed them, the DNS servers you have configured right now are probably the ones automatically assigned by your ISP. Fortunately, a number of other DNS servers are available for your use that you can choose from.

Contacting the website directly might also be a good idea. Chances are, assuming they're at fault, the website administrators are already working on correcting the cause of the 502 Bad Gateway error, but feel free to let them know about it.

Most websites have social networking accounts they use to help support their services. Some even have telephone and email contacts.

If you suspect a website is down for everyone, especially a popular one, checking X (formerly Twitter for chatter about the outage is often very helpful. The best way to do this is to search for #websitedown on X, as in #cnndown or #instagramdown. There are other ways to see if a website is down if social media isn't helpful.

Contact your internet service provider. If your browser, computer, and network are all working and the website reports that the page or site is working for them, the 502 Bad Gateway issue could be caused by a network issue that your ISP is responsible for.

See How to Talk to Tech Support for tips on talking to your ISP about this problem.

Come back later. At this point in your troubleshooting, the 502 Bad Gateway error message is almost certainly an issue with either your ISP or with the website's network—one of the two parties might have even confirmed that for you if you contacted them directly. Either way, you're not the only one seeing the 502 error and so you'll need to wait until the problem is solved for you.

To fix a 404 Page Not Found error , try reloading the web page and ensure you typed the correct URL. You may have the wrong URL, so try searching for the site from a search engine. You can also try clearing your browser's cache and changing the DNS servers, but if it's the website's problem, there's nothing you can do.

There isn't much you can do to fix a 500 internal server error ; the problem usually appears when there's an issue with the page or site's programming. However, you can try reloading the page, clearing your browser's cache, deleting browser cookies, or returning to the website later.

There isn't much you can do to fix a 403 Forbidden error because it typically stems from the site's development and design. To see if the problem is on your end, try checking for URL errors and clearing your browser's cache and cookies. See if the site is working for others; if so, contact the webmaster.

Get the Latest Tech News Delivered Every Day

  • How to Tell If Facebook Is Down
  • What Does a 403 Forbidden Error Mean? How Do You Fix It?
  • How to Fix a 500 Internal Server Error
  • 503 Service Unavailable Error Message: What It Is and How to Fix It
  • How to Fix a 504 Gateway Timeout Error
  • How to Fix a 401 Unauthorized Error
  • 404 Page Not Found Error: What It Is and How to Fix It
  • How to Fix a 400 Bad Request Error
  • DNS Servers: What Are They and Why Are They Used?
  • How to Fix a Privacy Error in Chrome
  • Is Google Drive Down...or Is It Just You?
  • 7 Most Common Online Error Codes
  • Is Twitch Down... Or Is It Just You?
  • Hulu Error Codes: What They Are and How to Fix Them
  • How to Fix a 408 Request Timeout Error
  • Learn the Meaning of a Network Gateway

How-To Geek

What is a 502 bad gateway error (and how can i fix it).

Why are bad gateways stopping me from seeing a website?

Quick Links

What is a 502 bad gateway error, refresh the page, check if the site is down for other people, try another browser, clear your browser's cache and cookies, check your plugins and extensions, restart your devices, change your dns servers, key takeaways.

A 502 Bad Gateway Error means the website you're connected to tried to relay information from another server and encountered an error. Try refreshing the page, clearing your cache and cookies, disabling your browser extensions, and switching your DNS server to resolve a 502 Gateway Error.

A 502 Bad Gateway Error occurs when you try to visit a web page, but one web server gets an invalid response from another. Normally, the problem is on the website itself, and there's nothing you can do. Other times, this error occurs because of a problem with your computer or networking equipment.

A 502 Bad Gateway Error means that the web server you've connected to is acting as a proxy for relaying information from another server, but it has gotten a bad response from that other server. It's called a 502 error because that's the HTTP status code that the webserver uses to describe that kind of error.

Related: How to Fix a 404 Not Found Error

These bad responses could be due to a number of different causes. It's possible the server is overloaded or there are network issues between the two servers, and it's just a temporary problem. It's also possible there's an improperly configured firewall or even a coding error, and that the problem won't get fixed until those issues are addressed.

Just like with 404 errors , website designers can customize how a 502 error looks. So, you might see different-looking 502 pages on different websites. Websites might also use slightly different names for this error. For example, you might see things like:

  • HTTP Error 502 Bad Gateway
  • 502 Service Temporarily Overloaded
  • Temporary Error (502)
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • 502 Bad Gateway Nginx

The vast majority of the time, this is just an error on the server-side of things that you won't be able to do anything about. Sometimes, it's a temporary error; sometimes it isn't. Still, there are some things you can try on your end of things.

Refreshing the page is always worth a shot. Many times the 502 error is temporary, and a simple refresh might do the trick. Most browsers allow you to refresh the page by pressing Ctrl+R on Windows or Cmd+R on Mac, and also provide a Refresh button somewhere on the address bar.

It doesn't fix the problem very often, but it takes just a second to try.

Whenever you fail to reach a site (for whatever reason), you can also check if it's just you that's having a problem connecting, or if other people are having the same trouble. There are lots of tools out there for this, but our favorites are isitdownrightnow.com and downforeveryoneorjustme.com . Both work pretty much the same. Type in the URL you want to check, and you'll get a result like this.

If you get a report saying the site is down for everyone, there's not much you can do but try again later. If the report shows that the site is up, then the problem might be on your end. It's very rare this is the case with a 502 error, but it is possible, and you can try some of the things we describe in the next few sections.

It's possible that an issue with your browser might be causing the 502 Bad Gateway error. One easy way to check this out is to use a different browser and see if it works. You can use Google Chrome , Mozilla Firefox , Apple Safari , or Microsoft Edge . If you can see the error in the new browser as well, then you know it's not a browser issue, and you should try another solution.

If trying a different browser works, it's possible that your main browser has cached outdated or corrupt files that might be causing the 502 error. Removing these cached files and trying to open the website could solve the problem.

It's certainly worth trying, and we've got a handy guide for you on how to clear your history in any browser .

Related: How to Clear Your History in Any Browser

If you use extensions on your browser, then it's possible that one or more of the extensions are causing the problem. Try disabling all your extensions and then accessing the website. If the error disappears after that, then it's likely that a plugin is causing the issue. Enable your plugins one by one to find the culprit.

Related: How to Uninstall Extensions in Chrome, Firefox, and Other Browsers

So, you've used a site checking tool and determined that the site is just down for you. And, you've tested another browser and are having the same problem. So you know the problem is likely something on your end, but it's not your browser.

Related: Why Does Rebooting a Computer Fix So Many Problems?

It is possible that there are some strange, temporary issues with your computer or your networking equipment (Wi-Fi, router, modem, etc.). A simple restart of your computer and your networking devices might help fix the problem.

Sometimes, DNS problems can cause 502 errors. Changing your DNS servers is not a likely fix, but it is a possible one. And it's not too hard to do. Unless you've changed them yourself, your DNS servers are probably be set by your ISP. You can change them to a third-party DNS server like OpenDNS or Google DNS, and that might solve the problem.

And there are other reasons you might want to change DNS servers, too---like better speed and reliability .

Related: The Ultimate Guide to Changing Your DNS Server

  • PRO Courses Guides New Tech Help Pro Expert Videos About wikiHow Pro Upgrade Sign In
  • EDIT Edit this Article
  • EXPLORE Tech Help Pro About Us Random Article Quizzes Request a New Article Community Dashboard This Or That Game Popular Categories Arts and Entertainment Artwork Books Movies Computers and Electronics Computers Phone Skills Technology Hacks Health Men's Health Mental Health Women's Health Relationships Dating Love Relationship Issues Hobbies and Crafts Crafts Drawing Games Education & Communication Communication Skills Personal Development Studying Personal Care and Style Fashion Hair Care Personal Hygiene Youth Personal Care School Stuff Dating All Categories Arts and Entertainment Finance and Business Home and Garden Relationship Quizzes Cars & Other Vehicles Food and Entertaining Personal Care and Style Sports and Fitness Computers and Electronics Health Pets and Animals Travel Education & Communication Hobbies and Crafts Philosophy and Religion Work World Family Life Holidays and Traditions Relationships Youth
  • Browse Articles
  • Learn Something New
  • Quizzes Hot
  • This Or That Game New
  • Train Your Brain
  • Explore More
  • Support wikiHow
  • About wikiHow
  • Log in / Sign up
  • Computers and Electronics
  • Operating Systems

How to Fix 502 Bad Gateway Errors on Mac: 10 Easy Methods

Last Updated: January 18, 2024 Fact Checked

This article was reviewed by Luigi Oppido and by wikiHow staff writer, Megaera Lorenz, PhD . Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years. This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources. This article has been viewed 3,119 times.

Have you ever tried to visit a website on your Mac, only to encounter an error message that says “502 Bad Gateway,” “502 Proxy Error,” or something similar? This error can have many causes, from web traffic being misdirected to the wrong IP address to a problem with the web host’s firewall or too much traffic overloading the server. Whatever the cause, we’ve put together a list of things you can try to fix these pesky errors so you can get back to browsing the web.

Things You Should Know

  • Many 502 errors will resolve if you just wait a few minutes and refresh the page.
  • Try clearing your cache to get rid of outdated information about the page stored in your browser.
  • Changing to a new DNS server may help if you have persistent bad gateway errors.

Refresh the page.

Sometimes 502 errors resolve on their own.

Check the site status.

The problem might not be on your end.

Clear your cache and cookies.

Your browser cache can save outdated site information.

  • Click the Safari menu at the top of your screen and select Settings or Preferences .
  • In the Advanced tab, check the box next to Show Develop menu in menu bar . If it’s already checked, leave it alone.
  • Open the Develop menu at the top of the screen and click Empty Caches . This will empty your caches without also deleting data like cookies or your browsing history .
  • If you want to clear cookies as well, go to Safari > Settings (or Preferences ) and click the Privacy tab. Click Manage Website Data and click Remove All .
  • Click the Chrome menu at the top of your screen and select Clear Browsing Data .
  • Check the boxes next to all the types of data you want to clear (e.g., history, cookies, cached files and images), then click Clear data . You can also select the timeframe you want to clear in the dropdown at the top.
  • Click History in the menu bar at the top of the screen.
  • Select Clear Recent History .
  • Check off Caches , Cookies , and any other data you want to clear and click Clear Now .

Try incognito mode.

This will help determine if the problem is with your browser.

  • You can also try visiting the page in a different browser. If it works, you’ll know the issue was with the browser you were using.

Reboot your Mac.

A software glitch could be to blame.

  • While you’re at it, check for updates to macOS and your browser(s) , since outdated software can cause a variety of errors.

Restart your modem or router.

Your internet hardware might be causing connection issues.

  • If you have more than one Wi-Fi network available, try connecting to a different one and see if that fixes the problem.

Change your DNS server.

DNS servers help direct your internet traffic.

  • Select Network in the sidebar on the left.
  • Click the type of network you want to use (e.g., “Wi-Fi” or “Ethernet”), then click Details next to your specific network on the next page.
  • Click the DNS tab on the left side of the window, then click + .
  • Enter a new DNS, such as Google’s public DNS server (8.8.8.8) or the free Cloudflare DNS (1.1.1.1). Click OK when you’re done. You can also click a server that’s already on the list and click the - button to remove it.
  • Click the Network icon. If you see a lock icon at the bottom of the Network pane, you’ll need to click it and enter your administrator ID to make changes.
  • Select the network service you want to modify in the list on the left, then click Advanced .
  • Click DNS .
  • Click the + button and enter your DNS server of choice (such as 8.8.8.8 or 1.1.1.1). You can also click any server on the list and select - to remove it. Click OK when you’re done.

Flush your DNS cache.

This can sometimes fix persistent connection problems.

  • Open the Launchpad in your Dock and search for Terminal . Click on the result.
  • If you’re using Monterey or later, enter the command sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press return . For earlier versions of macOS, check out our guide to flushing your DNS cache .
  • Enter your administrator password when prompted and press return again.

Shut off your VPN.

Your VPN could be interfering with your connection.

Troubleshoot your website if you’re the developer.

If lots of visitors are reporting 502 errors, the problem might on your end.

  • Temporarily turn off your CDN (content delivery network) and see if the problem goes away. The correct way to do this depends on which CDN you’re using.
  • Try turning off or reconfiguring your firewall. It might be blocking traffic to your server.
  • Run a traceroute to see if your server is currently accessible.
  • Test your website for script errors that could be causing problems.
  • Contact your website’s hosting company and find out if they’re experiencing any problems.

Expert Q&A

You might also like.

Automatically Shut Down Your Computer at a Specified Time

  • ↑ https://support.apple.com/guide/mac-help/enter-dns-and-search-domain-settings-on-mac-mh141272/13.0/mac/13.0

About This Article

Luigi Oppido

  • Send fan mail to authors

Is this article up to date?

safari bad gateway 502

Featured Articles

Convince Your Parents

Trending Articles

8 Reasons Why Life Sucks & 15 Ways to Deal With It

Watch Articles

Fold Boxer Briefs

  • Terms of Use
  • Privacy Policy
  • Do Not Sell or Share My Info
  • Not Selling Info

wikiHow Tech Help Pro:

Level up your tech skills and stay ahead of the curve

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

billyg27

502 Bad Gateway-Safari error whe using search

How can I SIMPLY correct a 502 Bad Gateway error using Safari search? I t started about a week ago. It works when I select a bookmarked website but not when I type in a name i.e. Macy's. I have a MacBook Pro (late 2013) w/MacOS Mojave 10.14.6 and Safari 13.0.2. Please keep it as simple as possible. Any suggestions?

MacBook Pro 13", macOS 10.14

Posted on May 24, 2020 3:12 PM

Similar questions

  • 502 bad gateway I get the message "502 Bad Gateway" when I start a new tab in safari and enter search criteria into the web address bar. I am sometimes only able to access my saved web pages. 570 1
  • After installing Safari 15.0 on Catalina I have problems opening a couple of (bank) sites I get the following message when opening an internet bank site: "A problem repeatedly occurred with" followed by the URL. Is anyone else experiencing this problem. There is no problem opening that site with another browser 348 1
  • Frequently get "Safari Cannot Load Page" Error Message I get this error redirect from a variety of websites, so don't think it is any specific site. When I switch to using Google Chrome, I don't have this problem. I am using Safari Version 15.4 (15613.1.17.1.13, 15613), macOS Catalina 10.15.7. Bryan 621 1

Loading page content

Page content loaded

May 25, 2020 6:22 AM in response to VikingOSX

safari bad gateway 502

In Safari Preferences there is no such option. I want to use Safari as my primary search engine not Google Chrome. I hope I haven't confused you more. Please help. I'm also having an issue with Mail. I have to Force Quit it lately. That's for another time.

May 25, 2020 11:45 AM in response to Eric Root

safari bad gateway 502

May 25, 2020 11:58 AM in response to billyg27

And on my macOS 10.14.6 (18G4032) Late 2013 iMac, I see this Software Update panel, whether I click menu : About This Mac : Software Update, or visit System Preferences : Software Update panel directly:

safari bad gateway 502

When the update for Safari 13.1 became available, it was a separate entry below the Catalina information above, and could be installed separately without invoking the Catalina installation. As the Late 2013 MBP is capable of installing Catalina, I am puzzled that you are not getting this panel above.

May 24, 2020 3:59 PM in response to billyg27

I cannot reproduce the 502 Bad Gateway (server side error) when entering Macy's in the Safari 13.1 address field on Mojave 10.14.6 (18G4032). You should have a separate entry in your System Preferences : Software Update below the Catalina Upgrade to apply the Safari 13.1 Update. Once done, see if the issue remains.

Eric Root

May 25, 2020 10:59 AM in response to billyg27

Did you check System Preferences : Software Update?

  • Trending Now
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial
  • 5 PDF Converters to Consider in 2023
  • CBSE Class 12 Computer Science (Self-Paced Course)
  • How To Apply For Service-Based Companies in India?
  • How to Become a Chief Technology Officer?
  • How To Explain Employment Gaps in an Interview?
  • No-Code Development - Start Your Freelancing Programming Career
  • How to Prepare Design Components For Front-End Developers?
  • Complete RoadMap For Second Year College Students – B.Tech/BCA/B.Sc
  • How Technology Has Influenced the Stock Market?
  • 10 Best Microsoft Edge Extensions That You Can Consider
  • 9 Features of Chrome Developer Tools That You Must Know
  • Best Tips and Strategies to Prepare for a Coding Interview
  • Are Robots Really Self-Learning?
  • 14 Important Coding Rules to Learn from Great Developers
  • 5 Ways to Use Social Media in a Right Way
  • DynamoDB: Understand The Benefits With Real Life Use Cases
  • Top 7 Database You Must Know For Software Development Projects
  • The Power of Computer Forensics in Criminal and Civil Courts
  • List of Useful Git Commands

How To Fix 502 Bad Gateway Error

Handling a 502 Bad Gateway issue can be somewhat inconvenient since it prevents access to web services or browsing. This error occurs when a server acting as a middleman gets an inaccurate response from a server upstream.

How To Fix a 502 Bad Gateway Error

This is a common HTTP status code that might have a variety of causes, including network issues, overcrowded servers, and incorrectly configured servers. In this comprehensive article, we will examine the causes of 502 errors and their solutions.

What is a 502 Bad Gateway Error?

An incorrect response from another server has been received by one internet server, which is indicated by a 502 Bad Gateway error. This error typically arises when an upstream server sends an incorrect response to a gateway or proxy server.

502 Bad Gateway Error

Alternatively, you could put it this way: each time you input the address of a website and press input, your request passes via multiple computers before arriving at the primary computer that hosts the page. Any of these middlemen who have difficulties completing your request will return a 502 bad gateway error to your browser.

Causes of 502 Bad Gateway Error

Have you ever experienced the dreaded “502 Bad Gateway” error when you were browsing the internet? This message may seem cryptic and can leave you wondering what went wrong. Do not panic, help is here! But first, let’s go through the common causes of this error:

Server Issues

  • Overload:  The server hosting the website is swamped with traffic and struggling to keep up. Imagine a busy highway overloaded with cars, causing delays and congestion.
  • Downtime:  The server is temporarily unavailable due to planned maintenance, technical issues, or unexpected outages. Think of it like a road closure for repairs, making it impossible to access your destination.
  • Misconfiguration:  Incorrect settings on the server, like firewall rules or software bugs, are preventing proper communication. It’s like a faulty traffic light causing confusion and disruption.

Communication Breakdown

  • Network Issues:  Problems with the connection between the server you initially connect to (gateway server) and the server hosting the website (upstream server) are disrupting communication. Think of it like a broken bridge hindering travel between two cities.
  • Timeout:  The gateway server waits too long for a response from the upstream server, exceeding its limit. Imagine sending a message that never gets delivered due to a communication timeout.

Additional Causes

  • DNS Issues:  Incorrectly configured Domain Name System (DNS) settings can lead the gateway server to the wrong server, similar to having an outdated map with inaccurate directions.
  • Code Errors:  Bugs in the website’s code or backend scripts can cause unexpected server behavior, leading to the 502 error. Think of it like a typo in a recipe causing the dish to come out wrong.

Understanding these causes equips you to troubleshoot the 502 Bad Gateway error more effectively. Stay tuned as we dive into solutions for both users and website owners in the next section!

How To Fix a 502 Bad Gateway Error

1. refresh the page.

Sometimes all it takes to resolve a momentary 502 issue is to reload the page. Your browser sends a new request for an updated version of the page to the server whenever you refresh a webpage. If the preceding request encountered an issue—such as a network outage or server overload—this could help.

To refresh a webpage, one can press Ctrl+R (Windows/Linux) or Cmd+R (Mac). Alternatively, one might consider clicking on the browser’s subheading “Refresh,” which is located at its address bar, or right-clicking on that page and finding “Refresh.”

If it still gives this error after refreshing then try accessing it through another browser or device to see if the 502 error persists. If this type of error does not stop happening, move to the next solution troubleshooting step.

2. Check Other Websites

Whenever there is a 502 error with any specific website you want to visit, check whether other websites will load. This helps to establish whether the problem stems from that site only or involves wider internet connectivity issues in your network connection.

Open a new tab on your web browser and visit several different websites. If other sites open without a hitch, then it is most probably something related to the website displaying the 502 error. But if several websites are either unavailable or loading slowly, there could be a bigger network issue taking place.

3. Clear Browser Cache

Cookie and cache problems in your browser might occasionally be the source of 502 bad gateway errors and other loading issues with websites. Because of this, deleting the cookies and cache from your browser can fix these problems and improve its functionality as a whole. To do this follow these simple steps:

  • Click on the icon of the menu with three dots which are located at the top right corner of the window.
  • Find “Clear browsing data” and click on it.
  • In this popup click on a range of times that you wish to remove information from (you can choose All Time for all cached files and cookies).
  • Tick off two boxes next to “Cookies and other site data” and “Cached images and files.”
  • Finally, click on Clear Data.

After clearing your cache and cookies from your web browser, try reloading the website displaying this 502 error. This will make your browser fetch a new version of it directly from its server which might fix this issue for you.

4. Restart Your Computer

Simply restarting your computer may occasionally resolve networking problems that could contribute to a 502 error . Restart your computer then access website again.

5. Clear DNS Cache

At times, DNS-related problems which are the main cause of error 502 bad gateway can be resolved by flushing the DNS cache. DNS or Domain Name System translates domain names to IP addresses that computers can connect with on websites. Here’s how you can clear your DNS cache:

  • Press Win + R to open the Command Prompt, type cmd, and hit Enter.
  • Type ipconfig /flushdns in the Command Prompt and then press Enter.
  • A message indicating that the DNS Resolver Cache was flushed will appear.

Flush-DNS-2

ipconfig /flushdns

Flush-DNS-3

DNS Resolver Cache was flushed

  • Open Terminal which is located in the Applications > Utilities folder.
  • Type sudo killall -HUP mDNSResponder on the Terminal window and press the Enter key.
  • You may be required to enter your administrator password. Just key it in and click on the Enter button.
  • A prompt showing that the DNS cache has been cleared will show up.
  • Open a terminal window
  • On some Linux distributions, use either of these commands depending on what you have:
  • For nscd (Name Service Caching Daemon) based systems: sudo systemctl restart nscd
  • dnsmasq- based systems: sudo systemctl restart dnsmasq
  • A notice saying that the DNS cache has been cleared should appear.

Once you have cleared your DNS cache, you can now try accessing the website to find out if it is still affected by the 502 error. If not, then put off your computer or modem and later restart them because anything related to a network may also bring about DNS problems.

6. Check Server Status

In order to check it, you can use online tools like Down For Everyone Or Just Me and enter the URL of the website that you want to get in touch with.

  • If everyone cannot access it; this shows that the problem is on site and should be handled by the administrators of that particular site. In this case, just wait for a server rebooting.
  • It might be possible that other users are able to open web pages while yours refuses to open. In this situation, you are supposed to analyze your internet connectivity or seek assistance from your provider within such setups.

7. Check Plugins and Themes

A 502 Bad Gateway error could be due to defective plugins or themes. It may be caused by flawed coding of one or both themes or plugins, disrupting the normal flow of the website.  For example, caching and security plug-ins may complicate server-to-server communications leading to this error. The problem can be addressed by disabling all your plugins and then turning on one at a time so as to pinpoint the cause of the problem plug-in. Here is how:

  • On your site’s dashboard, go to the Plugins section
  • From the options select ‘Deactivate’ for all plugins.
  • Refresh your website after each deactivation to see if the error is resolved.
  • Once this occurs again, you will know which plugin is causing it.
  • If disabling these widgets doesn’t help, you should also try turning off some themes.
  • In your website’s installation using the hosting panel or FTP program navigate to the themes directory.
  • Rename that directory that is named “themes-disable” for instance in order to fix errors with 502 status code showing up..
  • See whether your website starts working without any 502 errors.
  • If it does, rename the directory back to ‘themes’ and try activating your themes one by one until you find out what theme causes trouble..

By following this process of elimination you will get a clearer idea of how to fix any conflicts that are causing a 502 Bad Gateway.

8. Check Error Log

If you encounter a 502 Bad Gateway error after a specific change or update, the problem may be with your server. To diagnose this, check your website’s error log.

Most hosting services provide access to enable the website error log through an admin dashboard. For WordPress sites, you can enable error logging by adding the following lines to your wp-config.php file:

All errors will be logged in the wp-contents/debug.log file, helping you identify the cause of the 502 Bad Gateway error.

9. Contact Website Administrator

If all the above steps did not resolve the 502 Bad Gateway error, please reach out to the website administrator or hosting provider. They can access server logs and use diagnostic tools for identification of the problem and fixing it as well. For a quick resolution share with them exact details of what is happening.

502 Bad Gateway at Cloudflare: Whenever your website, acting as a reverse proxy through a content delivery network (CDN) called Cloudflare, runs an invalid response from your origin server, this error emerges. In such a case, Cloudflare will return a 502 Bad Gateway error to the web client. Therefore, bad things can happen between Cloud Flare and their origin servers due to several problems like temporary connectivity breakdowns, misconfigured origin servers and when servers are turned off.

502-Bad-Gateway-at-Cloudflare

502 Bad Gateway at Host: When your hosting server –also known as an origin server- returns a “502 Bad Gateway” error back to Cloudflare service; this happens in case of too much load on the server, incorrect server configuration or just transient nature of issues associated with it. Therefore Cloudflare fails to connect with their origin servers leading to 502 Bad Gateway.

502-Bad-Gateway-at-Host

These two variations have one thing in common, that is they have to identify root causes either between Cloudflare or your host’s web server in order to correct the 502 Bad Gateway situation.

Additional Steps for Advanced Users

  • Verify Proxy Settings: In case you are using a proxy server, verify if the proxy settings are correct. Such settings can sometimes cause a 502 error.
  • Turn Off VPN: If you use a VPN, turn it off temporarily and try to open the website again. Sometimes VPNs interrupt connections of websites leading to 502 error.
  • Check Firewall Settings: The firewall setting on your computer or network sometimes denies access to certain websites resulting in 502 errors. Check and adjust your firewall settings if necessary.
  • Keep Browser Up-to-Date: Make sure that your browser is up-to-date. Visiting some websites using old versions of browsers may lead to a 502 error because they don’t go well together.
  • Check DNS Settings: Incorrect DNS settings can sometimes cause a 502 error. Ensure that your DNS settings are configured correctly or try using a different DNS server.

To sum up, fixing this error requires an organized strategy. Frequently, such an issue can be resolved quickly by checking for internet disruptions, reloading the page, clearing browsing data, and correcting server status. If there are still issues with server performance logs must be checked, or an administrator contacted concerning this matter. These steps enable the user to effectively solve any occurring problems regarding 502 Bad Gateway errors in order for his/her site could remain usable and effective.

Please Login to comment...

  • How to Delete Whatsapp Business Account?
  • Discord vs Zoom: Select The Efficienct One for Virtual Meetings?
  • Otter AI vs Dragon Speech Recognition: Which is the best AI Transcription Tool?
  • Google Messages To Let You Send Multiple Photos
  • 30 OOPs Interview Questions and Answers (2024)

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

How To Fix a 502 Bad Gateway Error

502 bad gateway

When it comes to websites, there are a lot of different errors that can be downright frustrating and confusing. A few that come to mind are the white screen of death  or the frightening  error establishing a database connection .

But an even more popular one is the 502 bad gateway error. Why? Because this regularly happens around the entire web, not only to WordPress sites, but even popular services such as Gmail, Twitter, and Cloudflare.

Read more below about what causes this error and some solutions on how to quickly resolve it.

What is a 502 Bad Gateway Error?

The 502 Bad Gateway error specifically means that the server received an invalid response from an inbound server.

The Internet Engineering Task Force (IETF) defines the 502 Bad Gateway error as:

The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.

Every time you visit a website your browser sends a request to a web server. The web server receives and processes the request, and then sends back the requested resources along with an HTTP header and  HTTP status code . Typically an HTTP status code isn’t seen unless something goes wrong. It’s basically the servers way of notifying you that something has gone wrong, along with the code on how to diagnose it.

There are many different types of 500 status error codes ( 500 , 501 , 502 , 503 , 504 , 508 , 520 , etc.) which all have slightly different meanings.

These indicate that the request was accepted, but the server prevented the fulfillment of the request.

Check Out Our Video Guide to Fixing Different Types of 500 Errors

What Causes the 502 Bad Gateway Error?

The most likely causes of the 502 Bad Gateway are:

  • Server overload: the server ran out of resources and crashed, triggering an HTTP error 502. The possible reasons for this could be an unexpected spike in traffic or low memory.
  • Browser problems: your browser version is outdated or maybe there are corrupted files in your browser cache.
  • Firewall blocks: your firewall might be detecting false threats and blocking internet providers or IP addresses.

502 Bad Gateway Error Variations

502 bad gateway error in Chrome

Due to the various browsers, web servers, and operating systems, a 502 bad gateway error can present itself in a number of different ways. But they all have the same meaning. Below are just a couple of the many different variations you might see on the web:

  • “502 Bad Gateway”
  • “Error 502”
  • “HTTP Error 502 – Bad Gateway”
  • “502 Service Temporarily Overloaded”
  • “502 Proxy Error”
  • A blank white screen
  • “502 Server Error: The server encountered a temporary error and could not complete your request”
  • Temporary Error (502)
  • 502. That’s an error
  • 502 bad gateway Cloudflare
  • Bad Gateway: The proxy server received an invalid response from an upstream server

Another variation you might see is a “502 server error.”

502 server error in Chrome

And here is yet another variation. “502 – Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.”

502- web server received an invalid response

Other services such as Twitter might even show a completely different message for a 502 Bad Gateway error, such as “Twitter is over capacity.” This definitely looks a little more user-friendly.

Twitter is over capacity

And here is a snapshot of how Google displays it. “502. That’s an error. The server encountered a temporary error and could not complete your request. Please try again in 30 seconds. That’s all we know.”

Google 502 error

502 Errors Impact on SEO

Unlike 503 errors , which are used for WordPress maintenance mode and tell Google to check back at a later time, a 502 error can have a negative impact on SEO if not fixed right away. If your site is only down for say 10 minutes and it’s being crawled consistently a lot of times the crawler will simply get the page delivered from cache. Or Google might not even have a chance to re-crawl it before it’s back up. In this scenario, you’re completely fine.

However, if the site is down for an extended period of time, say 6+ hours, then Google might see the 502 error as a site level issue that needs to be addressed. This could impact your rankings . If you’re worried about repeat 502 errors you should figure out why they are happening to begin with. Some of the solutions below can help.

How to Fix the 502 Bad Gateway Error? 13 Methods

A 502 bad gateway error is typically a problem with the network/server, however, it can also be a client-side issue. So we’ll dive into a little of both. Check out these common ways to fix the 502 bad gateway error to get back up and running.

1. Try Reloading the Page

One of the easiest and first things you should try when encountering a 502 bad gateway error is to simply wait a minute or so and  reload the page (F5 or Ctrl + F5). It could be that the host or server is simply overloaded and the site will come right back.

2. Check the Site Status

Another thing you can do is to paste the website into  downforeveryoneorjustme.com . This website will tell you if the site is down or if it’s a problem on your side. There are also other tools that can help .

downforeveryoneorjustme

3. Try a Different Browser

You could try a different browser to rule that out as an issue. If you’re using Google Chrome, for example, try using Microsoft Edge .

In case the error goes away, it might be a good idea to delete and reinstall the browser you initially used.

4. Try in Incognito Mode

You can also access the site in Incognito mode . If the 502 bad gateway error doesn’t happen, the problem might be caused by a browser extension.

But how to identify the culprit extension? Try disabling them gradually, one after the other, checking if the website will open normally.

When this happens, you will have deleted the extension that was blocking your access.

5. Test on Another Device

If it looks like a problem on your end, you can try accessing the website on a different device.

Do the test: use your cell phone’s mobile data to access the page you want to see. If you succeed, restart your computer and other networking equipment, following the classic tip of unplugging your wireless router, waiting a moment, and plugging it back in.

That way you will understand if the error is related to your networking devices or something else.

6. Clear Your Browser Cache

Whenever you encounter issues like these it can be good to clear your browser cache. Below are instructions on how to do it in the various browsers:

  • How to Force Refresh a Single Page for All Browsers
  • How to Clear Browser Cache for Google Chrome
  • How to Clear Browser Cache for Mozilla Firefox
  • How to Clear Browser Cache for Safari
  • How to Clear Browser Cache for Internet Explorer
  • How to Clear Browser Cache for Microsoft Edge
  • How to Clear Browser Cache for Opera

7. Check for DNS Issues

A 502 gateway error could also be because of a DNS issue, such as the domain is not resolving to the correct IP, or the DNS server is not responding . If you have just migrated your site to a new host, is it important to wait for things to fully propagate, which can take up to 24 hours in some cases. This depends upon the TTL value of your DNS records.

You can also try flushing your local DNS cache . This is similar to clearing your browser cache.

In Windows simply open up Command Prompt and enter the following:

Command prompt - flush DNS

You should see a “Successfully flushed the DNS resolver Cache” if it worked.

For macOS users, you can enter the following in the terminal:

Note: There is no success message on Macs.

And lastly, you could temporarily change your DNS servers. By default, DNS servers are automatically assigned by your ISP. But you could try temporarily changing these to a  public DNS server , such as Googles. In fact, some prefer to use Google’s public DNS long-term. If you have a premium DNS propagation usually is a lot faster.

8. Check With Your Host

The primary reason we typically see a 502 bad gateway error is due to an issue with the web host. Sometimes a  query, script, or request will take too long  and so it is canceled or killed by the server. A lot of hosts, especially shared hosts implement what they call a “kill script.” Basically what this does is it will terminate a request after a certain period of time so that it doesn’t take a site down or impact other users. If you do a Twitter search for “ bad gateway ” you can see thousands of tweets happening every day alerting their hosting company of the problem.

502 bad gateway tweets

One reason you might want to consider moving to a host like Kinsta is that our platform runs in an  isolated software container  that contains all of the software resources required to run the site (Linux, NGINX , PHP, MySQL). This means that the software that runs  each site is 100% private and is not shared , even between your own sites. This greatly reduces the chance of seeing a 502 bad gateway error. We aren’t running aggressive kill scripts like some shared hosts are. And even if one of your sites does happen to go down, it won’t impact your other sites.

Another reason you could see a 502 gateway error with your host is also due to the fact that the server is simply not reachable, either because it is down or there is no connectivity. In this case, it is recommended to check your host’s status page  or open a support ticket.

9. Temporarily Disable CDN or Firewall

It could also be an issue with your  content delivery network (CDN) or firewall . If you are using a 3rd-party CDN provider an easy way to troubleshoot this is to simply disable your CDN temporarily. For example, we are big fans of the free CDN enabler plugin . If you are using that, you can simply deactivate the plugin and then test your site.

Wp-admin not working ? Simply log in to your site via SFTP and rename the plugin’s folder to cdn-enabler_old. This will temporarily disable the CDN connection. The same goes for WP Rocket or any other plugin you might have hooked up to your CDN.

Rename plugin folder temporarily

This can also occur sometimes with providers that provide DDoS protection and mitigation or fully proxy services like Cloudflare , as they have extra firewalls in-between. We have noticed that this happens once in a while on the Cloudflare free plan. Unfortunately, since Cloudflare is a fully proxy service, there is no quick way to simply disable it.

However, before you go blaming Cloudflare, it is important to know that there are two different types of 502 bad gateway errors variations with Cloudflare as seen below:

502 Bad Gateway at Cloudflare (Variation 1)

If you see the following screen, this is actually a problem on Cloudflare’s end, in which case you should reach out to them for support. You can also check Cloudflare’s status page to see if they’re currently experiencing an outage.

502 bad gateway error

502 Bad Gateway at Cloudflare (Variation 2)

If you see the following screen, this is a problem with your host.

Cloudflare 502 bad gateway at host

GoDaddy Firewall

Here is another example with of an HTTP 502 error and GoDaddy’s firewall. The issue is actually with the origin server (the hosting provider) due to a timeout, not the firewall itself.

HTTP 502 - GoDaddy Firewall

10. Check Your Plugins and Themes

A lot of times the reason for scripts and queries being canceled by the server is due to  bad code on your site, possibly from a 3rd party plugin or theme. We have also seen a lot of misconfigured caching plugins generate 502 errors. A few ways you can troubleshoot this is by deactivating all your plugins. Remember, you won’t lose any data if you simply deactivate a plugin.

If you can still access your admin , a quick way to do this is to browse to “Plugins” and select “Deactivate” from the bulk actions menu. This will disable all of your plugins . If this fixes the issue you’ll need to find the culprit. Start activating them one by one, reloading the site after each activation. When you see the 502 gateway error return, you’ve found the misbehaving plugin. You can then reach out to the plugin developer for help or post a support ticket in the WordPress repository.

Deactivate all plugins

If you can’t access your admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then check your site again. If it works, then you will need to test each plugin one by one. Rename your plugin folder back to “plugins” and then rename each plugin folder inside of if it, one by one, until you find it.

Rename plugin folder

Always makes sure your plugins, themes, and WordPress core are up to date . And check to ensure you are running a supported version of PHP. You can always reach out to your host for assistance. We use Kinsta APM  and other troubleshooting methods here at Kinsta to help clients narrow down what plugin, query, or script might be causing the error. You can also use your own custom New Relic key if you have your own license.

Time consuming queries to database

If it turns out to be an efficient query or bad code in a plugin, you might need to bring in a  WordPress developer  to fix the issue.

11. Check Logs

You should also take advantage of your  error logs . If you are a Kinsta client, you can easily see errors in the log viewer in the MyKinsta dashboard. This can help you quickly narrow down the issue, especially if it’s resulting from a plugin on your site.

Check error logs for 502 bad gateway errors

If your host doesn’t have a logging tool, you can also add the following code to your wp-config.php file to enable logging:

If you need more help on how to enable WordPress debugging mode here is a full step by step tutorial .

The logs are typically located in the /wp-content directory. Others, like here at Kinsta might have a dedicated folder called “logs”.

wordpress error logs folder sftp

You can also check the log files in Apache and NGINX, which are commonly located here:

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

If you are a Kinsta client you can also take advantage of our  analytics tool  to get a breakdown of the total number of 502 errors and see how often and when they are occurring. This can help you troubleshoot if this is an ongoing issue, or perhaps something that has resolved itself.

Response analysis 500 error breakdown

12. Restart PHP

Finally, you can also try restarting PHP. If you’re a Kinsta client, you can easily restart PHP from the tools menu within the MyKinsta dashboard. If your host doesn’t provide this, you can always open up a support ticket and ask them restart PHP.

Restart PHP

13. Check for PHP Timeout Issues

PHP timeouts occur if a single PHP process runs for longer than the max_execution_time or max_input_time set in the PHP configuration on your server.  This is a common occurrence if you’re doing big WordPress imports . When this happens a 502 server error is usually displayed. If you run into a PHP timeout these values may need to be elevated.

You can check with your current host about what values are set on your server and if they can be increased. On the Kinsta platform, these values are set to 300 seconds (5 minutes) by default. The maximum PHP timeout values available on our platform are based on your current hosting plan.

As you can see there are quite a few things you can do to troubleshoot and fix a 502 gateway error on your site. Typically this is not on the client-side, but rather an issue with your host. Third-party plugins and themes with bad code or unoptimized queries are also things to watch out for.

Was there anything we missed? Perhaps you have another tip on troubleshooting 502 gateway errors. If so, let us know below in the comments.

What Is a 502 Bad Gateway Error?

The 502 Bad Gateway error indicates that one server on the internet received an invalid response from another server. It’s a generic error alerting you that there’s something wrong with a website’s server communication.

What Causes the 502 Error?

The 502 bad gateway error is typically caused by issues related to the network/server, however, it can also be caused by client-side issues.

How Do You Fix the 502 Bad Gateway Error?

There are a number of things you can try when attempting to fix the 502 Bad Gateway Error:

  • Try Reloading the Page
  • Check the Site Status
  • Try a Different Browser
  • Try in Incognito Mode
  • Test on Another Device
  • Clear Your Browser Cache
  • Check for DNS Issues
  • Check With Your Host
  • Temporarily Disable CDN or Firewall
  • Check Your Plugins and Themes
  • Restart PHP
  • Check for PHP Timeout Issues

safari bad gateway 502

Brian has a huge passion for WordPress, has been using it for over a decade, and even develops a couple of premium plugins. Brian enjoys blogging, movies, and hiking. Connect with Brian on Twitter .

Related Articles and Topics

safari bad gateway 502

How to Fix a 500 Internal Server Error on Your Site

safari bad gateway 502

How to Fix the 504 Gateway Timeout Error on Your Site

  • Application Development
  • Website Security
  • Local Development

Gravatar for this comment's author

Nice article, would have liked to see recommendations for people hosting their own sites such as adding buffering, but understand that this is catered more towards people with managed hosting, that being said this article offers some good points on things those people can try.

Gravatar for this comment's author

Thanks Steven! Agreed, I’ll see if we can add some more tips to this.

Gravatar for this comment's author

On my website, 502 Bad Gateway is only caused when I use Cloudflare also Cloudflare causes more problems. Can you help me to solve them without disabling Cloudflare?

Gravatar for this comment's author

Hey Aqib! Sometimes a 502 bad gateway error can be a Cloudflare problem itself, especially on the free plan. However, a more common cause is that you perhaps misconfigured Cloudflare or there is a conflict on your site. It could very well be due to your hosting provider having issues. We always recommend asking your host to see if they can help diagnose the issue.

Gravatar for this comment's author

I contacted my host and they said my DNS was pointing to Cloudflare so I had to change my nameserver back to the original rather than cloudflare. However removing my site from cloudflare hasn’t fixed the problem. I’ll wait 24hours to see if it resolves.

Gravatar for this comment's author

hello, I am having serious troubles, my hosting randomly moved to a new server.

Since I have changed the A record to the new server IP address, nothing works properly, resources are not loading from the wp backend , websites are sometimes scrambled sometimes fine, most of the time when I click on pages of my site I get the 502 error in the second pic chapter 5 in this article, and if I refresh the page it works.

I have spent 8 days chatting with the hosting support and they are not able to fix this.

do you know what it can be?

I have tried everything, disabling Cloudflare, reinstalling plugins, I have sent HAR files all over support teams, nothing works!

Hey Marco! Sorry to hear about your trouble. If none of the above troubleshooting steps worked for you, my best recommendation would be to probably move to a better host. Here at Kinsta we utilize New Relic and can help pinpoint for clients where the issue is.

Gravatar for this comment's author

Hey, a lot of times my website gets an error 502. Please tell me how I can resolve this issue.

Hey Raju! Have you gone through all the troubleshooting steps above? We always recommend chatting with your hosting provider, as they should be able to help.

Gravatar for this comment's author

Thank you for the guidance..

Hello, Have you tried going through the troubleshooting steps above in the post? If you’re a Kinsta client, you can open up a ticket with our support team. Thanks!

Gravatar for this comment's author

Error 522 is an error code from Cloudflare’s proxy service. Please refer to this page here for more information on Cloudflare status codes.

Gravatar for this comment's author

I am having that issues, in the last week, UptimeRobot sending me mails 38 TIMES my site down, 5 minutes for each down, always 502

Leave a Reply Cancel reply

By submitting this form: You agree to the processing of the submitted personal data in accordance with Kinsta's Privacy Policy , including the transfer of data to the United States.

You also agree to receive information from Kinsta related to our services, events, and promotions. You may unsubscribe at any time by following the instructions in the communications received.

502 Bad Gateway Error: What It Is and How to Fix It

502 Bad Gateway Error: What It Is and How to Fix It thumbnail

Experiencing a 502 Bad Gateway error? Don’t brush it off too quickly. While a simple refresh often resolves a one-off, recurring errors might signal deeper issues.

If left unattended, these can snowball into significant challenges: Dwindling traffic, poor user experience, and elevated security risks, to name a few.

It’s important to root out the cause of the issue as soon as possible, whether it’s WordPress errors or something else.

The bad news: A variety of potential server-side issues could be throwing the error. The good news is that those error codes you see? They’re your map to effective troubleshooting.

We’ll explain in simple terms what the 502 Bad Gateway error is, why it happens, and most importantly, how to make it disappear.

Let’s get started.

What Is The 502 Bad Gateway Error?

What causes the 502 bad gateway error, how do you fix the 502 bad gateway error (9 possible solutions), solve the 502 bad gateway error.

First of all, a little bit of a crash course on what’s going on behind the scenes may help everything make a bit more sense. After all, knowledge is power, right?

Every time you enter a URL into an address bar and attempt to access a site, your browser sends a request to that site’s server. The server processes that request and then displays the website’s content.

A server is a computer that stores data. A web server is a type of server that stores and delivers web pages to users. Web servers are connected to the internet and use HTTP to send web pages to users who request them.

If something were to go wrong, you would instead see an HTTP status code . Then the fun begins.

You’ve probably faced a 404 error (page not found) at least once, if not a hundred times. It’s saying the server was able to process the request, but couldn’t locate the specific page or content.

In contrast, a 502 Bad Gateway error happens when there’s a communication breakdown between two servers. The first server relayed the message but received an invalid response from the upstream (or next) server.

In other words, the server, which acts as a gateway or proxy, received an invalid response from an inbound server and was not able to fulfill the request.

Depending on the browser you use, the status may appear in a handful of different ways:

  • 502 Bad Gateway
  • 502 Proxy Error
  • HTTP Error 502 – Bad Gateway
  • Temporary Error (502)
  • 502 Service Temporarily Overloaded

502 Bad Gateway

The HTTP 502 server error isn’t limited to a problem with a proxy server or server overload, so let’s dig in a little further and look at some common causes.

Several issues can return a 502 Bad Gateway error. These include:

  • An unresolved domain name – There could be connectivity issues between the domain name and your IP address. This often happens when a website recently migrated from one web host to a new hosting provider, and the DNS server hasn’t had time to propagate.
  • An oversensitive firewall – If your website (perhaps a WordPress site with a firewall plugin) or your web host has firewall settings that are too restrictive, some Internet providers or IP addresses may be blocked. This can happen when the firewall detects them as a false threat.
  • Server overload – A sudden spike in traffic can cause the origin server to crash. If your website’s server is on a shared hosting plan , your traffic can be impacted by everybody else’s traffic (like your neighbors are having a big party, and their guests are taking up all the parking spots.)

Having said the above, it should be noted that the 502 Bad Gateway error isn’t restricted to problems with the server. Client-side issues such as outdated browsers or corrupted files in the browser cache can also be a cause of the status error.

Now, let’s look at how to fix the 502 Bad Gateway error! We’ll cover two scenarios: an issue on the client side and a problem with the server.

1. Refresh The Webpage And Try A Different Browser

We should always start with the simplest solution. The 502 Bad Gateway error could be a temporary issue. For example, the web server may have become overloaded for a few minutes or experienced a brief surge in traffic.

Try waiting a few minutes and refresh the page. If that doesn’t work, you can try accessing the same site using a different browser. If that works, then the issue may be with the original browser. If the page still doesn’t open, the website itself may be the problem.

Another way to determine whether the problem is on your end or at the web server is to use a tool like Down for Everyone or Just Me , or Is It Down Right Now to confirm whether the problem is on your end or with the site’s host.

Down for Everyone or Just Me

Using one of these tools will identify the status of your site. If your site isn’t down for everyone, you’ll need to troubleshoot on your end, and the first several steps below will help with that. If your site is down for everyone, you’ll need to check into your site’s backend to find the source of the problem, which will be addressed later in the post.

2. Test Using Another Device

Assuming you’ve been using your computer and ISP, try to access your website from your cell phone. First, go to your phone’s settings and turn off your wifi, then make sure your mobile data is enabled. If you’re able to access your site, the problem is at your end, and rebooting your network may fix the issue.

To reboot your network, shut your computer down, then unplug your modem and router. If you have an integrated modem and wifi router, unplug it, wait for about a minute, then plug in your modem and let it reboot. Then plug in your router and let it boot up. If you have integrated hardware, plug it in and let it boot.

Finally, start your computer and try to access your site.

3. Clear Your Browser’s Cache

Browsers store a lot of data, primarily to help pages load faster the next time they’re opened. However, your browser cache may contain outdated site data or corrupted files, leading to the Bad Gateway error.

Based on this, the next thing to do is clear your browser cache . Depending on which browser you use, steps may vary.

If you use Mozilla Firefox, access the hamburger menu (three horizontal bars) at the top right. Go to History > Clear recent history.

Clear Recent History

From there, you’ll open a new menu and further options. If you were able to access your site without issue yesterday, then you can choose Today in the time range field, select Cache — you can deselect the other options if you want — and then click Clear Now .

Clear Cache

For the most part, the process will be much the same if you’re using Google Chrome, Microsoft Edge, Safari, or something else. If you’re unsure, check the process for clearing cache in other browsers for specific details.

If you try to access your site after clearing the cache and still get a status error, move on to the next step.

4. Flush The DNS Cache

A 502 Bad Gateway error could also be caused by a Domain Name System (DNS) issue. For example, if you’ve just migrated your site to a new web host, the propagation process can take up to 48 hours.

However, the issue may also originate with your local DNS cache. This temporary storage on your device contains information about previously visited domain names.

If you’re using Windows, you can flush the DNS cache using the Command Prompt . To access it, type “CMD” into the Windows search on your taskbar, and press Enter.

You’ll now have access to your Command Prompt .

Command Prompt

Once the Command Prompt box is open, copy or type the following command:

ipconfig /flushdns

Let it run. When it’s finished, you’ll see a message that says, “Successfully flushed the DNS resolver Cache.”

DNS Resolver Cache

If you’re using a Mac operating system, enter or copy the following command in the terminal.

dscacheutil -flushcache

If you’re uncomfortable doing either of these, you can also use a third-party service such as Google Public DNS to temporarily change your DNS server.

5. Check Your Site’s Error Log

If your site is down for everyone and the problem is local, you can also check your site’s error logs, which may help you identify the cause of your issue. For example, it may flag a plugin conflict or update as the source of your 502 Bad Gateway error.

Your website’s log files can be accessed via a Secure File Transfer Protocol (SFTP) client , such as WinSCP or SmartFTP . Once you’ve installed your client of choice, DreamHost provides a comprehensive Knowledge Base entry on accessing your error logs via SFTP.

Secure File Transfer Protocol (SFTP) is a safer version of the FTP protocol that uses a secure shell data stream.

6. Deactivate Your Plugins And Themes

Although it doesn’t happen often, a new or updated plugin or theme can cause conflict with other plugins or tools, resulting in a 502 Bad Gateway error.

Since you can’t access your WordPress admin dashboard, you’ll need to deactivate your plugins and themes using an SFTP client.

Once you’ve installed or logged into your SFTP client (see the section above for options) please refer to this DreamHost walkthrough for the steps to deactivate/disable your plugins. Note that you have the option of deactivating all of your plugins at the folder level or any single plugin of choice, perhaps the ones you’ve most recently updated or added.

When you’ve completed that step, try accessing your site again. If it’s up and running, log into your dashboard, access your plugins menu, and reactivate each deactivated plugin individually. Each time, make sure you refresh the page to determine if you still have access to your dashboard.

If you identify that a plugin is causing the status code error, either disable or delete it until the developer has released a fix.

If the problem didn’t originate from one of your plugins, you can go through this entire process again, except this time, focus on your Themes folder. Or carry on to the next possible fix.

7. Disable Your CDN Or Firewall

If everything so far has failed, the next thing to check is your Content Delivery Network (CDN) or firewall. Note that your firewall could be a stand-alone plugin, part of your overall security plugin, or implemented by your host.

CDN is an abbreviation for “Content Delivery Network”. It refers to a geographically-distributed network of web servers (and their data centers). The entities that make up a CDN collaborate to ensure speedy content delivery via the internet.

If you’re using Cloudflare , you can check to see if there are any reported issues. For example, the server might be undergoing scheduled maintenance:

Cloudflare System Status

If maintenance isn’t the issue, you can also try deactivating both your CDN and firewall through your host’s control panel. Since all hosts do not use the same control panel, it’s recommended that you contact them for assistance.

8. Restart PHP And Increase Your PHP Limits

The 502 Gateway Error could also be caused by a PHP timeout issue. This happens when the PHP process takes longer than the maximum load time and the request timed out.

Restarting PHP may help resolve your connectivity issues. Most hosts provide an option to restart your services via your control panel but if you don’t see that, you may want to ask them to do this for you.

Unfortunately, changing your server’s max_execution_time or max_input_time values may be necessary. By default, WordPress has these values set to 300 seconds, but you can increase PHP execution time via your host’s control panel, or reaching out to their technical support and asking them to do it for you.

9. Contact Your Hosting Provider

If you’ve been through the previous steps and nothing has helped, it’s time to consider contacting your hosting provider. There may be a server issue that’s affecting your site. Unfortunately, if that’s the case, there’s nothing you can do except wait for them to fix it.

Additionally, they may be able to identify the source of your 502 Bad Gateway error and walk you through a solution. Many hosts offer 24/7 support via chat and should be able to resolve the issue quickly.

The 502 Gateway Error is typically caused by a problem at the server. For instance, it may have experienced a spike in traffic that’s affecting performance and availability. However, the error could also be triggered by plugin conflicts and updates.

To troubleshoot the problem, start by clearing your browser cache and local DNS cache to rule out any issues on your end. Then, you can try disabling your plugins, themes, CDN, and firewall. If you’re still experiencing problems, consider contacting your hosting provider for assistance.

If you’re on a shared hosting plan, your 502 error may be because of another website’s traffic spikes. DreamHost offers VPS hosting that provides you with isolated resources and better performance, giving you more control and room to grow. Learn more about our VPS Hosting plans .

We Know You've Got Lots of VPS Options

Here’s how DreamHost’s VPS offering stands apart: 24/7 customer support, an intuitive panel, scalable RAM, unlimited bandwidth, unlimited hosting domains, and SSD storage.

VPS hosting provider

About the Author : Luke Odom

Luke is the Director of IT Operations. He is responsible for the teams that keep operations running smoothly... In his free time, he enjoys reading fantasy/sci-fi and hanging out with his wife and 4 kids. Connect with Luke on LinkedIn: https://www.linkedin.com/in/luke-odom-039986a/

Get Content Delivered Straight to Your Inbox

Subscribe to our blog and receive great content just like this delivered straight to your inbox.

site logo

What Is a 502 Bad Gateway Error (And How to Fix It)

It's important to understand what causes it

Author avatar

No one likes an error code! For most users seeing an error number isn’t helpful at all because the number doesn’t mean anything unless you’ve memorized the relevant codebook. 

If you run into a “502 Bad Gateway Error”, the problem is almost certainly an internal server error. It’s essential to understand the problem and, in some cases, there are a few measures you can take to resolve the issue. We’ll explain what this error means and explore ways to get things up and running again.

What Is a 502 Bad Gateway Error (And How to Fix It) image 1

HTTP Status Codes

The 502 error code is part of the HTTP error response code set. HTTP or Hypertext Transfer Protocol is the core protocol that makes the web work. It’s part of the larger internet suite of protocols and describes how servers and clients talk to each other when requesting or sending web content.

When your web browser (the client) requests data from a server using HTTP, and something goes wrong, the web server gives an invalid response resulting in an error code. The most famous of these is probably Error 404, which simply means the server can’t find a page at the address you’ve specified. 

The 5xx Error Code Family

There are five numbered sets of error response codes: 1xx, 2xx, 3xx, 4xx, and 5xx.

What Is a 502 Bad Gateway Error (And How to Fix It) image 2

The 5xx code group is all server error codes. This means when you see a code starting with the number five, the problem is almost certainly with the server. Most of the time, if something has gone wrong with the server, all you can do is wait and try again later. In general, these are temporary errors. If you’re trying to access a major service from the likes of Amazon or Google, these sorts of errors are almost immediately resolved unless there’s a major outage.

What’s a “Gateway”?

Error 502 Is a “Bad Gateway” Error. A gateway device is a node on a computer network that serves as a gateway to other web resources further upstream in the network.

What Is a 502 Bad Gateway Error (And How to Fix It) image 3

Your internet router or modem is a gateway device. So are the mega routers that your ISP uses to connect its users to the major trunks of the internet. If you want to know more about how it all fits together, read Who Owns the Internet? Web Architecture Explained .

A “Bad Gateway” then simply means that the gateway device could not retrieve the data you asked for from upstream servers in the network. Bad gateway, bad! 

Common Causes of the HTTP 502 Error

The 502 error can happen for various reasons, but most are server-side problems. An overloaded origin server is by far the most common reason. An origin server is a computer that contains the website and listens for requests from users to serve that content.

Server Overload

There may be too many people making requests of the server simultaneously, so it fails to honor any beyond its capacity. You may even see a “502 service temporarily overloaded” error instead of “bad gateway.”

DDoS Attacks

Sometimes servers are overloaded on purpose during a DDoS (Distributed Denial of Service) attack, but the result is similar. If the server takes too long, it will count as a server timeout, and you’ll get an error code. DDoS attacks aren’t as common as they’ve been in the past, thanks to services like CloudFlare, that act as a buffer between a server and a flood of requests. So any overload you encounter is most likely legitimate high usage.

What Is a 502 Bad Gateway Error (And How to Fix It) image 4

Server Misconfiguration

The server’s firewall or network settings may be misconfigured or erroneously identify your IP address as one that should be blocked. If you’re using a dynamic IP address (as most people do), you may have been assigned an address that a problematic user previously used.

The internet is incredibly complicated, and there are dozens, even hundreds of networking equipment devices between your device and the server you’re trying to access. Some of them might be having trouble.

Buggy Servers

Finally, the server might actually just be down or have software bugs that make it unable to fulfill requests. Remember, a server is just a computer, and someone or something may have messed it up. So until someone debugs the software, the problem will persist. You’ll find hundreds of articles on the web detailing how to fix issues with Apache webserver software , plugging holes in PHP code , or resolving configuration issues with their WordPress sites .

Now that you’ve got a good basic idea of the problem, we’ll look at the handful of things you can try when troubleshooting the issue.

Refresh the Page

If you’re faced with a 502 error, the first thing you should do is to refresh the web page. Most errors like this happen either because there’s a temporary network issue somewhere down the line or because the server is overloaded. You can also choose to wait until peak times are over (based on the time zone of the server location) before trying again. In 99% of 502 error cases, trying again later is the answer, but while you’re waiting, there are some other things you can do.

Check if the Site Is Down for Everyone

While a 502 error suggests that there’s a problem at the server’s end of the connection, it never hurts to make sure that you’re not the only one having issues. You can use websites like IsItDownRightNow? Or Down Detector to confirm that you aren’t the only one looking at an error code instead of the latest pictures of your mom’s dogs on Facebook.

What Is a 502 Bad Gateway Error (And How to Fix It) image 5

Some of these sites can show you important details such as how often a site goes down, whether it’s just down in certain regions, and whether any other users are complaining about specific problems at the moment.

Reset Your Router

Sometimes the bad gateway is the gateway in your house. Your router is a computer just like any other, which means it can hang, crash, or suffer from bugs. Like your other computers, a simple restart can usually resolve these issues. 

Suppose you find that you have to reset your router often to get your internet connection working again. In that case, you may want to perform a firmware update or consider buying a new router with more capacity to handle lots of devices at once.

Clear Browser Cache and Cookies

 [9 Clear.jpg]

Your browser keeps a cache of websites you visit often and those you’ve visited most recently. By maintaining a cache, you get faster site response times, and you’ll use less bandwidth to boot since you aren’t downloading common elements of the page every time you refresh or re-visit it.

Unfortunately, web browser caches can go wrong and get in the way of loading a page properly. So you may want to clear your browser’s cache. Don’t worry about losing your history, passwords, and other important information. All clearing the cache will do is perhaps slow down site access for a bit until a new cache can be built up. If you want to know how to clear the cache for your web browser, check out our ultimate tutorial: How To Clear The Cache Of Any Web Browser

What Is a 502 Bad Gateway Error (And How to Fix It) image 6

Cookies are another type of data that your browser keeps locally that can interfere with website loading. Generally, cookies are good for the website experience. They let a website “remember” information about you so that you don’t have to log in every time or lose the contents of your shopping cart if your connection is interrupted.

Apart from potentially messing up a site’s working, tracking cookies can also be a privacy problem, but either way, our tutorial How to Clear Any Web Browser’s History also shows you how to clear cookies. Just be sure to clear only the cookies and not your actual browsing history!

Update Your Browser

You should always keep your web browser up to date if only to make sure you have the latest security patches installed. If you have pending updates, complete them first before accessing the website that’s sending you an error. It might just be that your browser needs the latest web standards to speak to the latest website technology. 

It can’t hurt to make sure your operating system is also up to date since there may be issues related to network drivers or the network stack for your computer or device.

Try a Different Browser

Not every browser is made equal. If you’re using an embedded web browser or some other lesser-known browser, it may not support all the functionality or requirements of a given website.

It could also simply be that something has gone wrong with the browser you’re using. The fastest way to eliminate the browser as the source of the issue is to use a different browser. There are many to choose from, including Microsoft Edge, Safari (Mac or iOS), Mozilla Firefox, and Google Chrome, to name but a few.

Deactivate Plugins and Extensions

It might be worth starting up your browser or (temporarily) disabling all of your plugins and extensions to eliminate them as a source of the problem. Only do this if using a different browser without those extensions doesn’t show the problem on the same internet connection.

What Is a 502 Bad Gateway Error (And How to Fix It) image 7

Try a Different Internet Connection

If the server you’re trying to reach is fine, but a gateway device on the route to that server is the source of the issue, you may want to force a different route by using a different internet connection. 

For example, if your home broadband connection gives you the error, try accessing the site from your smartphone using your mobile data connection. Unless both connections are from the same ISP, this should bypass any ISP-specific issues.

Check Your Proxy Server

If you’re using a proxy server, the bad gateway in question could actually be that proxy server itself. Many workplace computers run through a company proxy server, and it’s not always possible to bypass these by design. After all, the company uses the proxy server to monitor what you do on the internet and control its information security.

Suppose you can’t bypass your proxy server connection in the proxy server config. In that case, your only alternative is to check if the proxy server is working correctly by asking the IT department. If you’re using a private proxy service, turn it off to check if that’s causing the problem. If you’re running your own household proxy server, reboot it and check if it’s still configured correctly.

While we like to refer to a “web server,” the truth is that most web content is hosted on multiple servers. Content Delivery Networks (CDNs) keep copies of web content on multiple servers spread worldwide. So when you request access to the site, the content is served by the CDN node closest to you, offering the best speeds and response times. It’s also cheaper to use local bandwidth rather than send data over international trunk lines, so companies favor using CDNs.

What Is a 502 Bad Gateway Error (And How to Fix It) image 8

The thing is, if your local CDN node is overloaded or having issues, you may get a 502 error. In theory, you’re supposed to be routed to the next working server node. But just in case, you can try using a VPN (Virtual Private Network) to access the website from another country or region within your own country. This may bypass the local server issue.

Flush Your DNS Cache or Change Your DNS Servers

DNS (Domain Name System) servers are like the telephone books of the internet. When you type an address like https://www.online-tech-tips.com (our sister site) into your address bar, the DNS server translates that into the correct IP address of the physical server that will send you the information you require.

A given DNS server may have the wrong IP address on file (it may have changed), or the server it’s referring you to might be one of several for the site, and that one is having problems. Your local DNS cache might also be corrupted or out of date.

You should first try to clear your DNS cache and try again. If that doesn’t work, you can change your DNS servers to see if that resolved the issue.

Google’s Public DNS servers found at 8.8.8.8 and 8.8.4.4 are some of the fastest and most reliable DNS servers in the world. 

Use a Cached Page Instead

If all you needed from a website was static information, you might not need the server to be up and running at all. Google and other search engines constantly index the web and make cached copies of web pages. There are also websites such as the Internet Wayback Machine, which archives both old and new web pages so you can see the information they had at various points in time.

It’s easy to see the cached version of a page using Google, just look for the three dots to the right of the result header and select it. 

What Is a 502 Bad Gateway Error (And How to Fix It) image 9

From the menu that pops up, choose cached .

What Is a 502 Bad Gateway Error (And How to Fix It) image 10

Then you’ll see a page with this message at the top.

What Is a 502 Bad Gateway Error (And How to Fix It) image 11

Contact the Site Administrator

The last piece of advice we can provide when facing a 502 Bad Gateway error is to get in touch with the website administrator. If the problem seems to be with your ISP, you can contact their customer support and ask if they’re aware of any problems with access to that particular site.

Many ISPs have a “known issues” section on their home pages or user account dashboards, so be sure to check these as well. In the end, if nothing in this article helps, it’s quite literally out of your hands, and all you can do is wait. So why not check out our Fun Stuff section for a few excellent ways to pass the time?

' src=

Sydney Butler is a social scientist and technology fanatic who tries to understand how people and technology coexist. He has two decades of experience as a freelance computer technician and more than a decade as a technologies researcher and instructor. Sydney has been a professional technology writer for more than five years and covers topics such as VR, Gaming, Cyber security and Transhumanism. Read Sydney's Full Bio

Read More Posts:

safari bad gateway 502

Home > How to Tips

What is 502 Bad Gateway on Mac/Windows & How to Fix it?

Updated on Wednesday, January 3, 2024

iBoysoft author Eudora Liu

Approved by

What is 502 Bad Gateway on Mac/Windows & How to Fix it?

Summary:  If you see 502 Bad Gateway on your Mac and Windows when you browse the Internet, this post is best for you to learn what it is, and how to fix it on Mac and Windows.

How to fix 502 Bad Gateway on Mac and Windows

When you browse the internet for a long time, or you frequently browse some websites known to be unreliable, you will turn into a 502 Bad Gateway error code on your screen. " 502 Bad Gateway Nginx " may be the most common prompt.

Like a 404 error code, the website designer can customize the appearance of 502 Bad Gateway on their website. So different web servers have different 502 errors, and you may have seen the following prompts.

  • HTTP Error 502 Bad Gateway
  • 502 Service Temporality Overload
  • Temporary Error (502)
  • 502 Server Error: The server encountered a temporary error and could not complete your request.
  • 502 Bad Gateway: Cann't Connect To Upstream Server

Don't be frustrated when you encounter such an error code, it's easy to be fixed. Just keep reading and try to fix 502 Bad Gateway on your Mac or Windows .

Share this post to help more people that have the same problem as you!

Table of Contents:

  • 1. What is 502 Bad Gateway?
  • 2. How to fix 502 Bad Gateway on Mac/Windows?
  • 3. FAQ about 502 Bad Gateway

What is 502 Bad Gateway?

A 502 Bad Gateway on your Mac/Windows indicates that the web server you've connected to is acting as a proxy for relaying information to another server (also called the upstream server), but it could not get a valid or any response from the origin server. The most common cause of this issue is an incorrect or outdated DNS record.

But what are the reasons for the 502 Bad Gateway error code? Answers may be the following.

  • Origin server down: The server is not accessible, because it is down or it is not connected to the server.
  • Domain name not resolvable: The domain name is not resolving the correct IP or does not resolve any IP.
  • Firewall blocks request: The firewall blocks the connection between the web server and the upstream server.

Turning to the web server's error log file, you can see more details of what the error especially entails. All the error and diagnosis information is stored in this file which is a valuable resource when you need more information about a peculiar error.

How to fix 502 Bad Gateway on Mac/Windows?

Usually, 502 Bad Gateway is the result of the server error, which means the server you trying to access is not accessible or down.

Now, you can use the following ways to fix 502 Bad Gateway on Mac or Windows.

Refresh the page

Refresh the browser is always worth a shot. Sometimes, the 502 Bad Gateway is just temporary, and refreshing the browser can solve the problem. Most browsers can do a hard refresh with a shortcut.

You can press  Control + R  on Windows or  Command + R  on Mac to refresh your browser. It's the easiest way you can do to fix 502 Bad Gateway. A refresh will send a new request to the server. The server may be down, but it can also be that the upstream server request times out. And refresh can fix this problem.

Check your Mac or Windows

If the above ways can't solve the problem, try to  restart your Mac  or Windows . If you have installed new software or made changes to your computer, it may cause 502 Bad Gateway. Try to restart your Mac or Windows and check if the error is fixed.

502 Bad Gateway may be caused by one of your extensions, try to  disable all your extensions  and load the website again, and see if the problem is solved. If you can access the website successfully, it's likely that a plugin is causing the problem. Just enable your plugins one by one to find the culprit.

If the problem still exists, try to  reset your router . Unplug your router from the power and wait 30 seconds. Then plug in the power outlet again and wait for it to connect to the internet. And load your website again.

If you think this post is helpful, share it with your friends.

Clear your browser cache and cookies

Before clearing your browser cache and deleting cookies, you can change the browsers to enter the same website. If it works, it proves that your main browser may be has cached outdated or corrupt files that may cause 502 Bad Gateway. Clear these cache and delete cookies, then open the website again could fix it.

Here are different ways to remove cache and delete cookies in different browsers:

  • Open the Safari on Mac.
  • Click the Safari icon on the left upper of the screen.
  • Choose  Settings  (or you can press " Command + Comma(,) " on the keyboard) in the pop-up menu.
  • Select  Privacy  in the top menu.
  • Click  Manage Website Data .
  • Choose all cache and cookies in the list.
  • Click  Remove All .

How to fix 502 Bad Gateway by clearing Safari cache

  • Click the three dots on the right upper of the Google website.
  • Choose  Settings  (Command + Comma) in the pop-up menu.
  • Click  Privacy and security  in the left sidebar.
  • Click  Clear browsing data .

How to fix 502 Bad Gateway by clearing Google cache

In Microsoft Edge:

  • Click the three dots on the right upper of the Microsoft Edge website.
  • Choose Settings.
  • Choose  Privacy and Services  in the left sidebar.
  • Click " Choose what to clear " below Clearing browsing data.
  • Check the cache and cookies you need to clear and click Clear Now.

After these steps, you can quit the website and turn to it again.

How to fix 502 Bad Gateway by clearing Microsoft Edge cache

Change your DNS servers on your Mac or Windows

If the problem still exists, you can try to change your DNS servers on your Mac or Windows. If you have ever changed your DNS servers before, your ISP may assign the default ones to you.

If your domain name is not resolving the correct IP or your DNS server is not responding, it can also cause 502 Bad Gateway. But you can try to use a public DNS server, such as Google's DNS server.

Now, you can follow the below steps to change your DNS servers to fix 502 Bad Gateway on your Mac or Windows. (Set Google's DNS server as an example)

Change DNS servers on Mac:

  • Check  System Settings  in Dock.
  • Choose  Network  in the left sidebar of the pop-up window.
  • Choose the network that you want to change the DNS server, such as Wi-Fi or Ethernet.
  • Click  Details , and then select  DNS  in the left sidebar.

How to fix 502 Bad Gateway by changing DNS server on Mac

  • Click OK to save your settings.

Change DNS servers on Windows:

  • Open Settings, and click  Network and Internet .
  • Scroll down and click  Change Adapter Options .
  • Right-click the network (Wi-Fi or Ethernet) you want to change the DNS server.
  • Select  Internet Protocol Version 4  and click  Properties .

How to fix 502 Bad Gateway by changing DNS server on Windows

  • Click OK to save the new DNS server for your Windows.

Except for these ways, you can change your DNS server in your router's settings. The process will be depending on your router, but you will be able to find the DNS settings in the Network or Internet section of the router's settings.

After you change the DNS server on your Mac or Windows, try to load the website again.

Clear DNS cache

Sometimes, DNS caching can also cause 502 Bad Gateway on your Mac or Windows. When you visit a website, your computer will store certain information about this site in your DNS cache. This can help your computer to load the site quickly the next time. But if the information is outdated, it will be due to a 502 error.

How to clear the DNS cache to fix 502 Bad Gateway on Mac or Windows:

Clear DNS cache on Mac:

  • Open  Terminal  by using the Spotlight or press  Command + Space .
  • Type in Terminal and double-click to open it.
  • Type in the following command.            sudo dscacheutil-flushcache; sudo killall -HUP mDNSRespnoder
  • Enter your Mac's password.
  • Press Enter to finish.

Clear DNS cache on Windows:

  • Right-click the Windows icon and choose  Windows Terminal (Admin) .
  • Click the down arrow icon and choose  Command Prompt  (or press  Ctrl + Shift + 2 ).
  • Type in the following command.         Clear-DnsClientCache

How to fix 502 Bad Gateway by clearing DNS cache on Windows

After you flush your DNS cache, try loading the website again.

Temporarily disable the firewall

As the above text refers to that, the firewall may block the connection between the web server and the upstream server. So you can temporarily disable the firewall to fix 502 Bad Gateway on your Mac or Windows.

Disable the firewall on Mac:

  • Click  System Settings  in Dock.
  • Choose Network in the left sidebar.
  • Select  Firewall  and switch the setting to  Off .

How to fix 502 Bad Gateway by disabling Firewall on Mac

Disable the firewall on Windows:

  • Click  Win > Settings .
  • Select  Privacy & Security > Windows Security > Firewall & network protection .
  • Select both  Private network and Public network .
  • Under Microsoft Defender Firewall, switch the setting to  Off .

How to fix 502 Bad Gateway by disabling Firewall on Windows

If this post helps you solve the problem, share your happiness with your friends.

FAQ about 502 Bad Gateway

The web server you've connected to is acting as a proxy for relaying information to another server (also called the upstream server), but it could not get a valid or any response from the origin server.

Because 502 Bad Gateway errors are often caused by issues between online servers that you have no control over.

Yes. Sometimes, a fault firewall configuration will cause your firewall to block requests from a content delivery network as an attack on your server and reject them, resulting in 502 Bad Gateway.

Eudora Liu is a new technical editor at iBoysoft. After professional training, she is able to write instructional articles about macOS and Windows and solve related problems.

Jessica Shee is a senior tech editor at iBoysoft. Throughout her 4 years of experience, Jessica has written many informative and instructional articles in data recovery, data security, and disk management to help a lot of readers secure their important documents and take the best advantage of their devices.

No. 308, 3/F, Unit 1, Building 6, No. 1700, Tianfu Avenue North, High-tech Zone

Copyright© 2024 iBoysoft ® . All Rights Reserved.

DMCA.com Protection Status

What is 502 bad gateway and how do you fix it?

We explain what is 502 Bad Gateway and what it means for users and website owners, and some potential steps for fixing it

502 bad gateway error spelt out in wooden blocks on a grey background to answer what is 502 bad gateway

A 502 Bad Gateway is a common error message users can encounter while browsing the web. It's a frustrating message to run into, as it's usually impossible to tell what has caused the issue or what you can do to fix it.

The 502 Bad Gateway is one of a number of error codes that can appear, preventing users from accessing content across that particular domain.

What does a 502 Bad Gateway error mean?

An Error 502 Bad Gateway appears when a browser is unable to connect to a website's host server, blocking access to content across that particular domain. This type of error will not be unique to one user, and instead will be appearing for anyone trying to access the website's content.

You can quickly check if there is a problem with your own PC or device by visiting a completely different website. If you can do this without any problems, then you can be assured that your connection is fine.

A 502 Bad Gateway error rarely lasts very long and is usually in the process of being solved by the site administrator by the time you see the error message. The ‘Error 502 Bad Gateway’ message has been around for many years, which means websites have become quite skillful at fixing them quickly.

Depending on the web server that's hosting the content you're trying to access, you may see additional letters or codes appear alongside an 502 Bad Gateway message. For example, you might see '502 bad gateway nginx', if the website is making use of the Nginx open source platform to handle load balancing. However, functionally, the problem is the same regardless of the server being used.

What causes a 502 Bad Gateway error?

Server overload: An overloaded server is one of the most common causes of a 502 error. This is where the server has reached its memory capacity, often activated by an unusually high number of visitors trying to access the same website. This can just be a coincidence or driven by a big event, but it can also be a targeted DDoS attack .

Get the ITPro. daily newsletter

Receive our latest news, industry updates, featured resources and more. Sign up today to receive our FREE report on AI cyber crime & security - newly updated for 2023.

Image of AMD servers with white text that says delivering profitable hosting services at lower prices

Choose the right CPU and server platform for your business

Request blocked by a firewall: With cyber criminals finding more and more ways to breach corporate networks, firewalls continue to play a key role in stopping them in their tracks. However, several firewalls can often go further than you’d like and inadvertently treat a massive influx of legitimate users as an attempted cyber attack. This can often occur with DDoS protection layers, which block requests from content delivery systems and cause the network to stop slowly.

Faulty programming: Often enough, a glitch or coding error in a website's code might result in requests not being answered correctly, sparking the 502 Bad Gateway error to show up.

Network errors: There is a multitude of potential networking errors that may occur, including potential DNS issues, routing problems, as well as issues relating to your Internet Service Provider (ISP). An ISP, for example, may have decided to block a certain web address.

Server software timeouts: The error can also show for users when a web server takes longer than expected to return a request, and the caching tool reaches its time values. Slower queries can also cause this problem.

Fixes for a 502 Bad Gateway error

There are a number of key steps that users can try to fix a 502 Bad Gateway error. However, it's important to note that because it's very likely the error is being caused by the website server, these solutions only work occasionally and should be thought of a last resort.

1. Refresh your browser

A close up shot of a refresh button on a Google Chrome browser

It sounds too simple, but in some cases where the server is overloaded with requests, sending a few more requests by refreshing the browser a few times can sometimes help reset the connection between the device and server, allowing you to resume browsing.

2. Clear your browser’s cache

A screenshot of a menu in Google Chrome showing an option to clear the cache and history

If refreshing the browser a few times doesn’t work then clearing the browser’s cache may help. Major browsers will make this option easy to find within their respective settings menus and most will simply let you enter a query using a search field to find the option. The browser’s cache stores important information that can become corrupted over time, so clearing this and re-attempting to connect to the server may do the trick.

3. Temporarily disable your firewall

A screenshot of a menu in Windows 11 showing a button for turning off the Defender Firewall

Not for amateurs, this is one of the more controversial methods on this list. Firewalls should always be active since they help block malicious threats from reaching your device. But, if you’re sure the server is safe to visit, then successfully re-attempting to visit the site with the firewall disabled can indicate there is an issue with the firewall’s settings interfering with network connections. You can adjust the settings in the admin console of the firewall provider.

4. Check with monitoring sites

A screenshot of a Downdetector results page showing a graph of the most recent outages across Microsoft 365

There are a few free websites you can use to determine if other users are also having the same issues as you. Sites such as Down Detector monitor most major websites and provide real-time reports as to whether other users can connect or not. If using one of these sites, it’s helpful to contribute by leaving a report of your own - most don’t even require a registered account to do so. Searching the website’s name on social media platforms such as Twitter can also indicate if others are struggling too.

5. Use a VPN

A screenshot of the Surfshark VPN tool on Windows 11

Choosing to re-route your internet traffic through a virtual private network (VPN) can be helpful in determining if your ISP is the issue with the connection to the site. Sometimes ISPs will block access to certain websites and if a VPN allows you to reach it, then it’s most likely being blocked by your provider. Contact their customer service team to remediate the problem in the long term.

6. Examine web server logs

If this error persists, it may require some further investigation to find a solution. Examining web server logs at the time of the error occurring will be a good place to start. If you are the owner of the website, you can check your FQDN (fully qualified domain name) is correctly resolving. You can also check a server is reachable via a ping text or traceroute.

How long does it take to fix a 502 Bad Gateway error?

A 502 Bad Gateway error can be fixed in a matter of minutes or hours, depending on its root cause. If it's possible to fix the issue on the client side, whether that's through a browser refresh, switching off a VPN, or clearing the cache, the problem could be resolved fairly quickly.

A graphic showing the HTTPS symbol

What is HTTP Error 503 (Service Unavailable) and how do you fix it?

What is HTTP Error 400 and how do you fix it?

However, if the issue is on the web server, it could take much longer to fix. For example, if a website owner has recently migrated their domain to a new host, it's possible that a 502 Bad Gateway error could pop up – something that could take a day or two to resolve.

That's assuming you're able to diagnose the fault in quick order. For example, a 502 Bad Gateway error may be caused by faulty network equipment, something that could go unchecked for some time. Even if you suspect an issue with the hardware, testing this theory takes yet more time.

Overall, it's very difficult to put a time frame on a fix, as this is entirely dependent on what is causing it in the first place.

Rene Millman

Rene Millman is a freelance writer and broadcaster who covers cybersecurity, AI, IoT, and the cloud. He also works as a contributing analyst at GigaOm and has previously worked as an analyst for Gartner covering the infrastructure market. He has made numerous television appearances to give his views and expertise on technology trends and companies that affect and shape our lives. You can follow Rene Millman on  Twitter .

Security experts raise questions about UK cyber funding in wake of Electoral Commission hack

ThreatLabz Report: The state of encrypted attacks

Why Python is the programming language of choice for AI developers

Most Popular

By John Loeppky March 19, 2024

By Steve Ranger March 18, 2024

By Kate O'Flaherty March 18, 2024

By George Fitzmaurice March 15, 2024

By Rory Bathgate March 15, 2024

By Keri Allan March 14, 2024

By Michael Allen March 13, 2024

By George Fitzmaurice March 13, 2024

By Drew Turney March 12, 2024

By Jonathan Weinberg March 08, 2024

By Rory Bathgate March 08, 2024

A webinar screen with contributor images on how network mordernization enables better security

The case for single-vendor SASE

A webinar screen with contributor images, with discussions around how to tame IT and security complexities with Cloudflare

Regain IT and security control: How Cloudflare’s connectivity cloud tames complexity

An orange webinar screen with contributor images, on security solutions for public sector resilience

Securing Europe: Cloudflare's cyber security solutions for Public Sector resilience

An orange webinar screen with contributor image. on retail trends and how to get ahead this year

The retail detail: Unveiling peak season Internet trends

  • 2 Platform engineering and Kubernetes go hand-in-hand – but businesses still struggle with implementation
  • 3 Why businesses should embrace the zero trust networking trend
  • 4 Ransomware group threatens to publish 3TB of stolen NHS Scotland data after posting proof of attack
  • 5 Security experts raise questions about UK cyber funding in wake of Electoral Commission hack

safari bad gateway 502

GreenGeeks

What is a 502 Bad Gateway Error and How to Fix It

One of the worst parts about the internet is the cryptic error messages that can appear. In most cases, they provide very little information, which leads users to have no idea how to fix them. And the 502 bad gateway error is one of the most common.

Most of the time, resolving these errors is very easy. But sometimes it can get a bit complicated. Unfortunately, it doesn’t help that the same error can come in a variety of forms.

The good news is that there are solutions, and I will demonstrate them today.

What Is the 502 Bad Gateway Error?

The 502 error occurs when the web server receives a bad response from an inbound request. In fact, any error message that begins with “5” means that the problem is with the response the server is receiving, but we are just focusing on 502.

Or in other words, when you were connecting to the website something went wrong. Yes, I know that’s not very specific.

The reason for that is that there can be multiple things that go wrong.

Here are the most common causes of a 502 Bad Gateway error:

Too Much Traffic

If you’ve tried buying a Playstation 5 online, I guarantee you have seen the 502 error because the most common cause is when too many visitors access the same page at the same time.

Essentially, the traffic is overloading the server’s ability to properly respond.

A Firewall Is Preventing Access

A firewall is intended to keep your device or server safe from malicious threats, and if it recognizes a site as malicious, it can block access.

Firewalls are causing fewer 502 Bad Gateway errors nowadays, but it is still possible. Whitelisting a site you trust can resolve this.

However, sometimes the firewall is not on your end and instead due to a CDN and web host not playing nice with each other.

The Website Recently Moved ( DNS )

If the website has changed servers, some domains need to make changes to the Domain Name System ( DNS ). This is what allows users to connect to your website and can sometimes take hours to be fully active.

In some cases, it can take over 24 hours before a website fully propagates itself after the transfer.

Corrupted Files In Your Web Browser

You’ve probably heard the term “Cache” before, but to keep it simple, this is information your web browser stores to enhance the user experience. However, if that data is not deleted after a lot of time passes, it can become corrupted and cause the 502 error.

If you have your browser set up to clear cache automatically, this likely isn’t the culprit.

The Server Is Down

Hardware will eventually stop working. If a web server decides to stop working, well, you can’t access that website anymore. Another possibility is that the server is undergoing routine maintenance.

Both scenarios can result in the same 502 error.

What Does the 502 Error Look Like?

Probably the most aggravating part about the 502 status code is that there are a ton of variations. Some websites have even taken it upon themselves to customize the error page and leave out the 502 part.

As you can imagine, this makes identifying the problem even harder.

Here are some of the messages you may encounter when experiencing this error:

  • 502 Bad Gateway
  • 502 Service Temporarily Overloaded
  • HTTP Error 502 Bad Gateway
  • 502 Proxy Error
  • No Message (White Screen)
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • Temporary Error (502)
  • 502. That’s an error
  • 502 Bad Gateway Cloudflare
  • Bad Gateway: The proxy server received an invalid response from an upstream server

And that’s just some of the error messages you may encounter! It gets a lot more complicated when website owners customize the message. Although to be fair, some of these custom messages are much more helpful.

For example, you might have seen the “ Twitter Is Over Capacity ” error screen (where the whale is being lifted by the Twitter birds). If you recall, one of the reasons the error occurs is due to server congestion, or too much traffic.

This message is much clearer than what was just listed above. However, it’s not always better.

For instance, Google uses the default “502. That’s An Error.” message which looks nice but doesn’t really tell the user anything.

How to Fix the Bad Gateway Error

Now that you know what the error is and how to identify it, let’s talk about solutions. The good and bad news is that there are a lot of ways to resolve this error.

None of them are particularly difficult, and in some cases, the problem might not be on your end.

1. Reload the Page

This one might make your eyes roll, but it is by far the most consistent way to resolve this error. When you reload the pages, you are actually sending the server another request. Thus even if the first one failed, this one may succeed.

However, odds are, you have already tried reloading the page to no avail. If the core problem is congestion (too many people at once) then this might actually make the situation worse as you are just adding to the users trying to access the page.

However, sometimes the simplest solution is the most effective.

2. Load the Page On Another Web Browser

The cache stored regarding your website can sometimes cause this error. To determine that is the case without clearing your cache, all you need to do is try accessing the website on another browser.

If you are still encountering the error, it is not related to the cache.

However, if the error is resolved, then go back to the previous web browser and clear the cache to resolve the error.

3. Check the Status of Web Servers

All web servers undergo maintenance, and in most cases, the website owners are alerted to it from their web hosting companies before it happens. In many cases, those websites will let visitors know the website may be down via social media.

If this is the case, there’s nothing you can do but pass some time and try again after the maintenance is over.

It is also worth contacting your web hosting company to have them verify your web server. Sometimes the web server may be down without them notifying you, which can cause you a lot of headaches trying to resolve an error out of your control.

4. Flush Your DNS

If this is your own website and you have recently migrated to a new server, then the cause is likely a DNS error. This will take time to resolve, but one way to speed it up is to clear your local DNS cache, which is essentially the same as clearing browser cache.

Note: The method to flush local DNS is different on Windows and Mac.

On Windows, open up a command prompt and enter “ ipconfig /flushdns ” and within a few seconds you should see a success message that reads “Successfully flushed the DNS  resolver Cache.”

For Mac users, paste the following line into the terminal “ dscacheutil -flushcache “. However, unlike Windows, there is no success message.

5. Change the DNS

The DNS server is an essential part of how you connect to the internet. DNS issues can increase gateway issues, but changing the DNS servers is relatively easy.

The ISP (internet service providers) sets the DNS server settings. But users can set them to third-party DNS settings and resolve those issues.

Options like OpenDNS or Google DNS are good choices. Changing the DNS server increases the website speed and reliability for ranking.

6. Check Your Firewall

If you use a CDN like Cloudflare, there are actually two firewalls that can cause a problem, and you do not have control over either one. The first would be the CDN’s firewall, and the second would be the web host.

The good news is that these error messages can be a bit clearer.

In many cases, the massage will show you where the connection problem is occurring. Then, you need to contact the necessary party to resolve it.

Granted, sometimes they may try to point the finger at each other, but alerting each party is usually enough to resolve it.

7. Check Your Plugin & Theme (WordPress Only)

WordPress is a terrific platform, but sometimes not every plugin and theme is coded well. And sometimes as a result of bad code, your website can produce 502 errors in an inconsistent manner.

The first step is to determine what is causing it.

One way to do this is to disable all of your plugins and see if the error persists. If it does not, then you need to determine which plugin is the culprit. At this point, you want to activate each plugin one at a time and check for the error.

If it is not a plugin, then be sure to check your theme. Obviously changing your theme is not ideal, but it is necessary to determine if it is causing an error. Cloning your website onto a subdomain to test this is a smart choice.

8. Check the Error Log

Most web hosting companies offer you an error log in one form or another. These just list the errors your website experiences, but unlike the 502 Bad Gateway error, these are easier to pinpoint the cause.

How you access them changes depending on your web host.

For GreenGeeks customers, simply log into the cPanel , and view the Errors in the Metrics sections . If you enabled the debug mode in WordPress , you can also check that error log as well.

9. Try Using or Disabling a VPN

Sometimes using a VPN can either cause or solve the problem. In either case, if you are using a VPN, try disabling it. If not, consider trying a VPN to see if the error is resolved. This means something is wrong when the request is being sent from your device.

The good news is that if you don’t have a VPN, many offer free trials you can try to see if it works.

10. Clear Cookies and Cache

Solving the browser gateway error indicates problems with cache build-up. Corrupt files in the cache could stop the internet browsers from accessing the targeted website.

If you face a gateway error because of a bad cache, you need to remove it. Users need to access the browsing history tab through options and follow these steps:

  • Access the internet browser’s options by clicking on the options tray.
  • Select the History option located and click on it
  • Clear browsing history by choosing the option available
  • Choose the “All Time” option located if you are using chrome
  • Mark the cookies and cache removal as well
  • Wait for the internet browser to remove all your history, cache, and cookies .

Note : Reloading the websites with a clear cache can reduce the website loading speed.

11. Restart the Device

Temporary issues with the internet router or the computer system can also trigger the gateway warning. Additionally, there’s a chance that some systems might face problems because of WordPress themes.

It’s best to remove the ones you might have installed on your system and see if that solves the problem. We also suggest checking if the problem is on the user’s end.

Identifying these problems by restarting the internet router or the computer system can help. It makes it easier to check for possible problems caused on the user’s end after removing plugins.

What If None of These Solutions Work?

In the unlikely event that none of these solve your issue, and assuming that your server is not down, the only option left is to double-check everything and let some time pass.

Many web hosting support teams can help you troubleshoot this error if the problem persists.

If the problem stems from too much traffic, there is not much you can do but wait, or upgrade your servers to accommodate larger crowds.

Does A 502 Bad Gateway Error Impact SEO Rankings?

If the 502 error persists for several hours, it can result in lower rankings on search engines. However, if your website has just gone down due to this error, a search bot will still crawl your website like normal using a cache.

Imagine a website gets ranked and crawled consistently during its downtime. The server will probably crawl from the cache, not giving the browser a chance to re-crawl the pages. It doesn’t matter if your site is down for a few minutes.

The bot may return after a set period of time to ensure the error is gone. At this point, if the error is not resolved, your rankings will be impacted.

Thus, you need to ensure this error does not occur regularly.

Don’t Let Error Messages Frighten You

Error messages are common on the internet for both visitors and website owners. No website will ever be error-free, and that’s fine. What is important is how fast you respond to an error and attempt to solve it.

In reality, only errors that exist for a prolonged period of time will have an impact on your rankings, so don’t panic.

Which solution worked for you? Did you take any steps to prevent it from happening in the future?

Related Posts

Best wordpress hosting 2014.

Migrate Drupal WordPress

How to Migrate a Drupal Website into WordPress

Leave a comment cancel reply.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed .

safari bad gateway 502

502 bad gateway: What it means & how web developers can fix these errors

Everything you need to know about gateway errors, how to fix them, and how to prevent them from happening.

safari bad gateway 502

From time to time, you may open a website to find nothing but a blank white page, perhaps with bold black letters reading “502 bad gateway.”

That error message is even more of a headache when it’s your website that’s failing to load. Luckily, you can start troubleshooting HTTP errors like this as soon as you understand the information they are conveying.

Any time a website fails to load properly, you risk frustrating visitors, losing potential conversions, and negatively impacting your search engine ranking.

But how do you mitigate this? It's simple: by understanding how HTTP status codes work, you'll be able to troubleshoot more quickly and solve 502 bad gateway errors on your site.

What is a 502 bad gateway error?

A 502 bad gateway error is a server-side error indicating that the proxy server you are using to connect to another web server has received an invalid response. This happens when a web server is being used as a gateway to fetch the data you need to load the page from an upstream server.

A 502 bad gateway error is a type of Hypertext Transfer Protocol (HTTP) status code . These HTTP status codes are issued by the server when you make a request, so if you understand what the codes mean , you can decipher errors and troubleshoot more easily. The four HTTP status code types are:

  • 100 Informational - Your request was received by the server, and it is processing further.
  • 200 Success - Your request was completed, and the browser received the expected response from the server.
  • 300 Redirection - Indicates the server needs to take another action, like a 301 redirect , which you can use to reroute a URL to an updated page on your website.
  • 400 Client Error - The request was invalid. This happens when a site or page can’t be reached, like a 404 page not found error .
  • 500 Server Error - Indicates your request was valid, but there is a problem on the server side. This is the category the 502 error falls into, along with the common 500 error that indicates an internal service issue.

A 502 bad gateway error may not always appear the same way every time. There are different versions of the 502 error message, including a blank white screen. Some of the most common include:

  • 502 bad gateway
  • 502 server error
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • Bad Gateway: The proxy server received an invalid response from an upstream server
  • HTTP Error 502 – Bad Gateway
  • 502 proxy error
  • 502 Service Temporarily Overloaded
  • Temporary Error (502)

What are the common causes of a 502 bad gateway error

The cause of an error can originate from the user’s equipment, the website’s hosting services, or the CMS used to manage the website.

  • Unresolved DNS - An incorrect or outdated DNS record can result in visitors receiving a 502 error. This may be caused by their DNS server, equipment, browser, or ISP. A DNS error can also happen temporarily if a website has just switched hosting services.
  • Other browser or home equipment issues - There are other issues that can originate from the user’s equipment that can cause or perpetuate a 502 error, like browser extensions.
  • The origin server is down - The server the hosting service is using to store the website data is down. This could be due to overload or other technical issues.
  • A firewall is blocking the request - This happens when a website’s CMS is overzealous in its security services, like DDoS protection systems.

If you know what may be causing an error, you will be able to hunt down the origin and make sure it gets resolved quickly. 

From the fundamentals to advanced topics — learn how to build sites in Webflow and become the designer you always wanted to be.

What to do if you see a 502 bad gateway page when browsing

If you are browsing the internet and receive a 502 bad gateway page, you can try a few techniques to fix it on your end. 

First, try checking to see if the website is down generally or just for you. Check a website like downforeveryoneorjustme.com and the business’s social media for other folks receiving the same error. Or see if a friend can access the site from their browser.

If you can’t find any indications the website is down, try some of the following strategies:

  • Refresh the page. The first and easiest step — this often does the trick.
  • Try accessing the site on another browser. For example, if you’re on Chrome, try Firefox.
  • Check the website on your other devices. For example, if you’re on mobile, check on your laptop.
  • Restart your browser or computer. Reload the page after restarting your browser or computer.
  • Clear your cache or delete your cookies. Sometimes, the site is back up but your browser cache version is still giving you an error.
  • Use your browser in “ safe mode ” without extensions or add-ons. Some extensions can “break” websites.
  • Restart your router and modem. Your home equipment can be the origin of unresolved DNS errors.
  • Wait and try again later. Sometimes, you just have to wait out a server error. Most are resolved quickly, and you’ll have luck trying again in a few minutes.
  • Reach out to the website owner. If you’ve been trying to access a site for a while with no luck, you can use social media or email to contact the website owner and inquire about it.

How to prevent and fix a 502 bad gateway error on your website

If it’s your own website that has started serving 502 bad gateway errors, you’ll want to fix it as soon as possible to avoid disappointing your users and negatively impacting your SEO . A temporary server error that is resolved within a few minutes won’t hurt your search ranking. However, frequent extended periods of server errors will become detrimental

Note: you may not always be able to fix a 502 error since it is often caused on the hosting or user side, but there are some ways you can prevent, fix, or mitigate the impact of 502 errors.

1. Contact your web hosting provider

First, reach out to your web hosting provider to look closely at the problem and provide more information. They will have greater visibility into the servers hosting your site and may be able to pinpoint the problem.

Check your plugins, themes, and firewall

If your CMS uses a lot of plugins or themes those add-ons can cause problems that result in a 502 error. Check each plugin or theme that you are using on your site. You can also temporarily disable your firewall or plugins in your CMS to see if the problem is there.

In general, you want to choose plugins that are updated frequently and instead, opt for a CMS that relies less on plugins for functionality.

Make sure users can contact you

Your visitors may be the first to notice that your site is down or showing 502 bad gateway errors. They can alert you so you can quickly resolve the problem. Make sure they have an easy way of contacting you in addition to your website. This could be social media, a publicly available email address, or a Google Business Profile .

Customize your error page

You can create customized error pages for your website fairly easily. While it doesn’t solve the problem, users will feel like they are still reaching your website and it’s simply unavailable rather than just getting a blank page. A custom page can make your site look more professional and help ensure visitors come back and try again.

The Twitter Fail Whale is a popular example of a 502 bad gateway error page, and it helped keep users engaged while Twitter dealt with the technical problems. You can follow this custom 404-page tutorial and create an error page that’s designed to match the rest of your site. Consider building a creative 404 page for an easy moment of delight for your users, or you can even create your own illustration or purchase a design like these 502 bad gateway illustrations from Dribbble .

Choose reliable hosting and support to prevent errors from the start

An ounce of prevention is worth a pound of cure. Prevent 502 errors and other HTTP problems on your site by making sure it is set up securely from the beginning. Choose a reliable CMS and web hosting service , and the security practices , technical SEO , and redirects you set up will all help you avoid negatively impacting your user’s experience with error codes.

Select your web hosting carefully. Your hosting service will play the biggest role in how fast and reliable your website is. Read reviews and look for hosting services that are tailored to the volume of traffic and content quantity on your website. You want to look at speed, reliability, scalability, security, and customer support. With high-quality hosting, your visitors will be able to reliably access your site whenever they want to.

Subscribe to Webflow Inspo

Get the best, coolest, and latest in design and no-code delivered to your inbox each week.

Related articles

safari bad gateway 502

SSL certificate: What it is and why your website needs one

Learn what an SSL certificate is and how it helps you make your website more secure and attractive to both visitors and search engines.

safari bad gateway 502

How to improve your website’s performance: Best practices and tips

Discover optimization techniques to enhance your website’s performance, ensuring a seamless user experience that attracts visitors and converts customers.

safari bad gateway 502

301 redirects: what they are and how to use them

When you move or delete pages on your website, 301 redirects help keep traffic flowing. Learn how 301s work — and the best practices for SEO.

safari bad gateway 502

7 best website performance test tools in 2024

Looking to improve your website’s performance? Here are seven of the best website performance test tools you need to check out.

safari bad gateway 502

Http vs. https: What’s the difference and why does it matter?

When it comes to HTTP vs HTTPS, one small letter makes a big difference in keeping your site — and your users’ data — secure and trustworthy.

safari bad gateway 502

How not to write an error message

Discover all the ways the internet’s most well-meaning messages can go horribly, horribly wrong.

Get started for free

Try Webflow for as long as you like with our free Starter plan. Purchase a paid Site plan to publish, host, and unlock additional features.

Transforming the design process at

  • Interactions
  • Localization
  • Figma to Webflow Labs
  • DevLink Labs
  • Feature index
  • Accessibility
  • Webflow vs WordPress
  • Webflow vs Squarespace
  • Webflow vs Shopify
  • Webflow vs Contentful
  • Webflow vs Sitecore
  • Careers We're Hiring
  • Webflow Shop
  • Accessibility statement
  • Terms of Service
  • Privacy policy
  • Cookie policy
  • Cookie preferences
  • Freelancers
  • Global alliances
  • Marketplace
  • Libraries Beta
  • Hire an Expert
  • Made in Webflow
  • Become an Expert
  • Become a Template Designer
  • Become an Affiliate

WebNots

Home » Web Tutorials » Web Design » How to Fix 502 Bad Gateway Error?

How to Fix 502 Bad Gateway Error?

In today’s day and age, everyone uses the internet. Often, when using the internet, and visiting web pages, there can be connectivity problems between the computer and the website. These connectivity problems come up with certain error codes referred as HTTP status codes . These codes are classified as 1xx , 2xx , 3xx , 4xx and 5xx based on the type. All 5xx status codes are received from the server side due to different reasons.

Also, learn how to fix err_connection_reset , err_internet_disconnected , err_network_changed and err_connection_closed errors in Google Chrome.

What is 502 Bad Gateway Error?

502 bad gateway is one the examples of 5xx HTTP status codes returned by the server. This error means that one of the servers has received an invalid response from the other. These servers connect through their “DNS”, which is essentially an online phone book for different connections on the internet.

502 Bad Gateway Error

Where Can This Error Occur?

The “502 Bad Gateway” error, much like other connection errors, can occur on any device, any browser or any application that connects to the internet. Remember “504 Gateway Timeout ” and “503 Service Unavailable” errors are different that of “502 Bad Gateway” error. Though all 5xx errors are returned due to problems at server side in general.

Is the Error Related to Your End of the Connection?

The “502 Bad Gateway” error isn’t necessarily related to your end of the connection. These errors are likely caused by the online server, and not yours. Sometimes, the error is a tiny fault, and there may not actually be an error there, the browser is just thinking that there is. However, in saying this, there are several ways that this can be checked.

Below are some possible ways to fix the problem, do each of them in order, and move on to the next if the previous one doesn’t work.

1. Reloading the Page

This is by far the best thing to try first, as most online server errors are only temporary, and can be resolved with a simple reloading of the page. Click on the refresh button or F5 page to reload the webpage again.

Refresh Page in Chrome Chrome

Remember not to reload the pages when you are doing payment other form submission to avoid duplication.

2. Close and Re-Open the Browser

This is the next best option. Try starting a new browsing session by basically closing all your active browser windows and tabs, and then opening the browser again, and trying to load the page once more.

3. Clear the Browser Cache and Cookies

Often when there is a browsing error, the cache has become cluttered and has started causing problems with the processing of new server addresses, due to the likely build-up of other server addresses. It can be a good idea to clear this on a regular basis. This can be done by opening the settings or tools menu in your browser and clearing the history.

While there, it can be a good idea to clear the browser cookies as well, as this may relate to the problem, and is often just an extra tick box when clearing the cache, depending on the browser.

4. Use Incognito or Private Browsing

Sometimes the plugins and extensions installed on your browser may cause conflict with the response received from the server. It is a good idea to disable them and check the site can be opened without issue. The easiest way to do is to open the browser in private or incognito mode.

Incognito mode disables all extensions and will help to narrow down the issue if at all it is related to your extensions.

5. Open the Webpage with Another Browser

The problems may well be related to the browser software itself, so try opening the page with a different browser. For example, if using Google Chrome, open it with Microsoft Edge.

6. Restart Your Computer and Modem/Router

Sometimes, a computer can have temporary issues with connecting to online servers, so it’s a good idea to try and restart the computer. While the computer is restarting, restart the modem/router that you are connected to. Once the computer and the modem/router are back up, try opening the page again.

7. Check Your DNS

DNS generally speeds up the internet connection but sometimes wrong cache in your browser or PC or ISP side may cause the error. Follow the steps in this article to clean up the DNS cache – flush DNS in Windows 10 .

8. Use Public DNS

There are countries like China where internet is censored. 502 dad gateway error more likely to occur because of the DNS servers. The local DNS servers will take long time resolve the global site addresses. In such a case try using Google public DNS instead of default DNS from ISP.

Learn how to change DNS servers in Windows 10 and Mac .

9. Use VPN or Proxy Server

If public DNS does not work, try using reliable VPN or proxy server. This will help to bypass all corrupted local DNS servers and use private DNS to access the sites. Using VPN you can easily switch the server and access the site similar to accessing from local location.

10. Contact the Website Administrator

If all the above fails, the problem likely isn’t on your end, and it’s definitely a good idea to try and approach the website administrator, so that they can try and fix the problem as quickly as possible. Especially when you see the 502 bad gateway error from Cloudflare, inform the site owner so that they can setup the CDN properly.

Cloudflare 502 Bad Gateway Error

If you don’t find the email address of the site owner, just drop a mail to “ [email protected] ”. In most cases, site owners will use catch all email to collect all emails addressed to one single id and then respond accordingly.

11. For a Website Owner

Below are additional steps you can take if you are the website owner:

  • Check your DNS propagation if you have done any changes in DNS zone file
  • Check caching and CDN setup, you can purge the caching to rebuild your cache.
  • Refer the server log file to get more details about all the errors recorded on your site.

Above are the different possible solutions you can try to fix 502 bad gateway error. If none of the above helped you to access the site then rest assured that the problem at the server side. All that’s left to do at this point is to wait and see if the website gets fixed and come back another time.

About Editorial Staff

Editorial Staff at WebNots are team of experts who love to build websites, find tech hacks and share the learning with community.

You also might be interested in

Fix ERR_CONNECTION_REFUSED Error in Chrome

Fix ERR_CONNECTION_REFUSED Error in Chrome

ERR_CONNECTION_REFUSED is a well known error and mostly, it happens[...]

Fix Your Connection is Not Private Issue in Google Chrome

How to Fix Your Connection is Not Private Error in Google Chrome?

Sometimes, while surfing a website on the internet with Chrome[...]

How to Add PWA Feature to Your WordPress Site?

How to Add PWA Feature to Your WordPress Site?

Web designing is an ever-changing area that evolves based on[...]

DOWNLOAD EBOOKS

  • SEO Guide for Beginners
  • WordPress SEO PDF Guide
  • Weebly SEO PDF Guide
  • Alt Code Emoji Shortcuts PDF
  • ALT Code Shortcuts PDF
  • View All eBooks

TRENDING TECH ARTICLES

  • 600+ Windows Alt Codes for Symbols
  • Fix Chrome Resolving Host Problem
  • Fix Slow Page Loading Issue in Google Chrome
  • View Webpage Source CSS and HTML in Google Chrome
  • Fix Safari Slow Loading Pages in macOS
  • Fix Windows WiFi Connection Issue
  • ROYGBIV or VIBGYOR Rainbow Color Codes
  • Fix I’m Not A Robot reCAPTCHA Issue in Google Search
  • Structure of HTTP Request and Response

POPULAR WEB TUTORIALS

  • Move WordPress Localhost Site to Live Server
  • Move Live WordPress Site to Localhost
  • Move WordPress Media Folder to Subdomain
  • Fix WooCommerce Ajax Loading Issue
  • Create a Free Weebly Blog
  • Edit Weebly Source Code HTML and CSS
  • Add Scroll To Top Button in Weebly
  • Add Table in Weebly Site
  • How to Add Advanced Data Table Widget in Weebly?
  • Up to $500 Free Google Ads Coupon Codes

FREE SEO TOOLS

  • Webpage Source Code Viewer
  • HTTP Header Checker
  • What is My IP Address?
  • Google Cache Checker
  • Domain Age Checker Tool
  • View All Free Web and SEO Tools

© 2024 · WebNots · All Rights Reserved.

Type and press Enter to search

NGINX Error: 502 Bad Gateway – Causes and Solutions

Introduction.

The NGINX 502 Bad Gateway error is a common HTTP status code that indicates that one server on the internet received an invalid response from another server. This error is frustrating for both webmasters and users alike. In this tutorial, we will explore the common causes of a 502 Bad Gateway error in NGINX and provide step-by-step solutions to resolve the issue.

Understanding 502 Bad Gateway Error

502 Bad Gateway is an HTTP status code that signifies that the server received an invalid response from the upstream server. This can happen for a variety of reasons, but it generally means that your NGINX server is acting as a proxy and cannot get a proper response from the backend servers.

Common Causes of NGINX 502 Bad Gateway

  • Server Overload
  • Failure in Server Communication
  • Faulty PHP-FPM Configuration
  • Domain Name System (DNS) Errors
  • Firewall Blocking Communication

Diagnosing 502 Bad Gateway Error

Before diving into the solutions, it’s critical to identify where the problem is occurring. Check your NGINX error logs, usually located at /var/log/nginx/error.log . Use the following command to have a look at the last few lines:

Look for keywords such as ‘connect() failed’ or ‘upstream prematurely closed connection’ to pinpoint the issue.

7 Solutions to Fix 502 Bad Gateway Error

Check if the upstream server is running.

Ensure that the server NGINX is trying to reach is operational. Use commands like ps, top, or htop to check if the server processes are running.

If the process isn’t running, start it with your service management tool:

Examine Your Proxy Settings

The proxy settings within your NGINX configuration file might be incorrect. You should verify the configuration of the proxy_pass directive. It should point to the proper address of the backend server.

Raise the Buffer And Timeout Limits

In some cases, the default buffer sizes are not enough for the response headers of the backend server:

Increase timeout values to prevent premature closing of connections:

Restart NGINX Server

If you have made changes to the NGINX configuration, you need to restart NGINX to apply those changes:

Correct Network Configuration Issues

If there’s a network misconfiguration, NGINX might not be able to reach the upstream server. Ensure that you have the correct subnet, gateway, and DNS settings. Firewall settings may also lead to network issues, so verify that the firewall is not blocking traffic between NGINX and the backend.

Configure PHP-FPM Properly

PHP-FPM often requires a good deal of fine-tuning to function smoothly. Tune your PHP-FPM settings in the www.conf file (could be located at /etc/php-fpm.d/ or /etc/php/7.4/fpm/pool.d/ depending on your configuration). Here are some common modifications:

Monitor Server Resources

High traffic can overload your backend servers resulting in 502 errors. Monitor server resources like CPU, memory usage, and disk I/O to ensure that servers are properly scaled for handling traffic.

Preventing 502 Bad Gateway Errors

Optimizing server performance and reliability involves routine maintenance and monitoring. Implementing health checks, load balancing, and proper resource allocation can greatly reduce the occurrence of 502 Bad Gateway errors.

Through careful monitoring and proper server configuration, 502 Bad Gateway errors can be avoided, providing a stable and responsive experience for users.

Understanding the causes of NGINX 502 Bad Gateway errors is half the battle. With careful configuration, monitoring, and server management, you can ensure your sites remain online and are performing well. If you’ve followed the steps in this tutorial and continue to see issues, contacting your hosting provider or seeking support on NGINX forums may be your next best step.

Next Article: NGINX 400 Bad Request Error: Request Header Or Cookie Too Large

Previous Article: How to migrate from Apache to NGINX

Series: NGINX Tutorials

Related Articles

  • Git: What is .DS_Store and should you ignore it?
  • NGINX underscores_in_headers: Explained with examples
  • How to use Jenkins CI with private GitHub repositories
  • Terraform: Understanding State and State Files (with Examples)
  • SHA1, SHA256, and SHA512 in Terraform: A Practical Guide
  • CSRF Protection in Jenkins: An In-depth Guide (with examples)
  • Terraform: How to Merge 2 Maps
  • Terraform: How to extract filename/extension from a path
  • JSON encoding/decoding in Terraform: Explained with examples
  • Sorting Lists in Terraform: A Practical Guide
  • Terraform: How to trigger a Lambda function on resource creation
  • How to use Terraform templates

guest

Search tutorials, examples, and resources

  • PHP programming
  • Symfony & Doctrine
  • Laravel & Eloquent
  • Tailwind CSS
  • Sequelize.js
  • Mongoose.js

502 Bad Gateway – How To Fix

safari bad gateway 502

Lee Stanton Lee Stanton is a versatile writer with a concentration on the software landscape, covering both mobile and desktop applications as well as online technologies. Read more October 18, 2021

As a website visitor or owner, seeing the “502 Bad Gateway” error might be puzzling since the specific issue isn’t clear. This is a popular, generic, HTTP status code. Assuming your Internet connection is fine, seeing this message means there most likely is a server communication problem. And the result is you not seeing the web page you’ve requested.

502 Bad Gateway - How To Fix

Although the 502 error is typically a problem on the server side, the cause may occasionally be on the client’s end. In this article, we’ll help you get to the bottom of this mystery by trying out simple client-side tips. You’ll either clear the problem or get closer to understanding the cause.

502 Bad Gateway Meaning

Whenever you try to access a web page, your browser basically asks the webserver to access the page. The web server will then process your request and return the resource you asked for along with an HTTP header and HTTP status code.

But if there is a server issue, you might receive one of several different 500 error codes. All of them indicate a problem with the server. Therefore, the “502 Bad Gateway” error – the request from the client ­(your browser) – was good but the server was unable to return the resource asked for.

502 Bad Gateway Fix

Here are some tips you can try from your web browser to hopefully clear the “502 Bad Gateway” error and get your webpage displayed.

1. Try Reloading the Page

The error could be caused by a glitch with the server as opposed to an outage, and server connectivity issues can be fixed reasonably quickly in most cases.

Start by reloading the page – click on the circular arrow near the URL address bar. In Chrome and Safari, it’s on the left, in Firefox it’s on the right. Wait a minute or so before reloading the page. If the web page displays, then the problem has disappeared.

Another quick thing you could try is to open a new browser session. Close all your open browser windows, then open a new window and try navigating to the web page again.

2. Try Clearing Your Browser Cache

Your web browser saves information from each website you visit in the browser cache. Whenever you re-visit a website, the pages load quicker because your browser uses what’s stored in the cache.

However, this setup isn’t always a good thing. If your browser’s cache has an outdated or corrupted version of the website, this can cause the 502 error. Consider clearing your browser’s cache to get the most up-to-date version of the web pages your trying to reach. Here’s how that’s done:

safari bad gateway 502

  • Ensure only the “Cache” box is checked, then “Clear Now.”

To empty the cache in your Safari browser, the “Develop” menu needs enabling. To do this:

safari bad gateway 502

  • Go to “Develop” then “Empty Caches.”

502 Bad Gateway in NGINX

PHP-FastCGI Process Manager (PHP-FPM) is a background process for handling web server requests for PHP apps. NGINX passes web requests onto PHP-FPM worker processes that execute the PHP application. NGINX returns a “502 Bad Gateway” error when it can’t successfully delegate a request to PHP-FPM or if PHP-FPM doesn’t respond.

Here are the most common causes for NGINX returning a 502 error:

  • PHP-FPM is not running.
  • NGINX is unable to communicate with PHP-FPM.
  • PHP-FPM is timing out.

Now let’s see how to confirm whether any of the above is the problem, and how to fix it.

1. Check Whether PHP-FPM Is Running

When PHP-FPM isn’t running, NGINX will return a 502 error to all requests intended to reach the PHP application. You can use a “ps” command via a Linux host to check for running PHP-FPM processes. The command is:

“ sudo ps aux | grep ‘php’ ”.

If the results from this command don’t display any PHP-FPM pool or primary processes, PHP-FPM needs to be running to fix the 502 errors. To make your PHP app more reliable, consider using “systemd” to manage PHP-FPM as a service in your production environment. PHP-FPM’s background process will start automatically serving your PHP app whenever a new instance opens, or your server begins.

Since PHP-FPM is built-in to the PHP code, you can add it as a “systemd” service when you set up PHP. Once the project is set up as a service, use this command for an automatic start:

“ sudo systemctl enable php7.2–fpm.service ”.

2. Check Whether NGINX Has Access to the Socket

Once PHP-FPM starts, it generates Unix or TCP sockets to connect to the NGINX web server. The PHP-FPM worker processes need the sockets to listen for NGINX requests. Ensure that PHP-FPM and NGINX are set to use the same socket

PHP-FPM uses a different config file per process pool. To find these files go to:

“ /etc/php/7.2/fpm/pool.d/ ”.

Pool sockets are outlined in a “listen” instruction in its config file, e.g. the following “listen” instruction, configures a pool called “mypool” to use a Unix socket found at: “ /run/php/mypool.sock ”:

“ listen = /run/php/mypool.sock ”.

If NGINX is unable to access a pool’s socket, you can work out which worker pool it is by examining which socket is specified in the NGINX error log. If PHP-FPM didn’t start the “mypool” worker pool, for example, NGINX would send a 502 error and the log entry would look similar to this:

“ Connect () to unix: :/run/php/mypool.sock failed (2: No such file or directory)”.

3. Check Whether PHP-FPM Is Timing Out

When your application takes too long to respond, users will receive a timeout error. If PHP-FPM’s timeout – fixed in the pool’s configuration (“request_terminate_timeout”) instruction – is less than NGINX’s timeout, NGINX will return a 502 error.

You can increase PHP-FPM’s timeout setting in the pool’s configuration file. However, this could cause another problem: NGINX could time out before getting a response from PHP-FPM.

NGINX’s default timeout is 60 seconds. If you’ve increased the PHP-FPM timeout over 60 seconds, and your PHP app hasn’t had time to respond, NGINX will issue a “504 Gateway Timeout” error. Avoid this by increasing your NGINX timeout setting.

502 Bad Gateway in Cloudflare

Cloudflare will return a 502 error when it’s unable to start a valid connection with your website’s source webserver or if the Cloudflare service is unavailable or configured incorrectly. The most common causes include:

  • The source server is overworked with too many server loads triggering server downtime
  • WordPress websites with low PHP memory limits or too many MYSQL connections can cause the server to load slowly
  • Incorrect DNS records, plugin or theme conflicts in WordPress, and service failures e.g. PHP-FPM and cache services

Try the following tips to resolve the”502 Bad Gateway” error from Cloudflare:

1. Reload the Page and Clear Your Cache

Reloading the webpage should be the first thing you try for any error message. The 502 error, specifically, may be the result of the server being overloaded causing temporary connection issues. Wait for a minute or so before reloading the page; this typically solves it.

If the 502 error still shows, clear your browser cache then try again. Long press Ctrl + F5 for Windows and Linux browsers. For Chrome and Safari on Mac, it’s Cmd + Shift + R.

2. Check Your Plugin/Theme for Conflicts

If you use WordPress, the 502 error may be down to a misconfigured plugin. To troubleshoot whether this is the cause, disable your plugins – no data will be lost.

  • Sign in to your WordPress account.
  • Select “Plugins” from the sidebar.
  • Apply a “Deactivate” to all your plugins.

If the 502 error is solved, then you need to find which plugin is a problem. To do this, individually reactivate the plugins. After reactivating each one, reload the web page. When the Cloudflare error happens again, you’ll know which plugin is the culprit. You can request help from the plugin developer by posting a ticket in WordPress.

Ensure your themes and plugins are the latest versions, and your PHP version is supported.

3. Temporarily Disable Your Firewalls and CDN

The problem could be caused by the Content Delivery Network (CDN) or firewalls. This is a common issue with providers with extra firewall layers like Cloudflare. You can either check Cloudflare’s online status page for information on any problems with their service, or you can contact them.

If it’s confirmed that the problem is with your firewalls or CDN, try disabling them temporarily, then enable them after.

4. Check Your DNS Servers

Sometimes your Domain Name System (DNS) servers can return the 502 error because your website’s domain may not be pointing to the right IP address. If you’ve recently moved your website to another hosting service then you’ll need to wait for at least 24 hours for the propagation across the Internet to complete.

If this is not the case, to clear IP addresses and other DNS records from your local DNS cache you can try flushing it, here’s how:

  • Launch a command window.

safari bad gateway 502

Or via a Mac:

  • Open a terminal window.
  • Enter “ dscacheutil -flushcache ”.

502 Bad Gateway Solved!

The “502 Bad Gateway” error message is a standard response when there is something wrong with communications between the servers involved in returning your web request. The 500 error message typically means that there is a problem with the server-side of the exchange. However, at times, the cause can be with the user’s local computer equipment and/or network setup. Luckily, this is a very common error, and there are plenty of things you can try yourself to get your webpage displayed, or at least bring you closer to understanding the root cause.

What other error messages have you experienced when visiting web pages? Did the problem get resolved? Let us know in the comments section.

Related Posts

safari bad gateway 502

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

WordPress How to Change Theme Name

Lee Stanton March 18, 2024

How to Find the MAC Address of Your Amazon Fire Tablet

Lee Stanton March 16, 2024

WordPress How to Link to Another Page

Send To Someone

Missing device.

Please enable JavaScript to submit this form.

Itsourcecode.com

HTTP Error 502 Bad Gateway: What it Means and How to Fix it?

Are you trying to access a website and then an HTTP error 502 bad gateway message suddenly appears on your display?

What does a 502 bad gateway error mean and what are the root causes of this error?

If you’re not familiar with this error, don’t worry because this article will help you rectify it. So, keep reading until the end so that you’ll understand 502 bad gateway meaning why it occurs and, most importantly, you’ll learn how to solve it.

What is a 502 Bad Gateway?

A 502 Bad Gateway Error is a type of HTTP status code that shows up when one server gets an invalid response from another server it’s communicating with.

This error is a sign of communication issues between the servers involved and can disrupt internet services.

HTTP Error 502 Bad Gateway

In a nutshell, the HTTP Error 502 Bad Gateway occurs when the server gets an incorrect response from another server, or when a gateway server is unable to establish where it was communicating with to complete the request.

In other words, this error does not indicate that you have a problem with your device or with your internet connection.

This error is a originates from the server.

502 Bad Gateway Error Variations

There are many types of browsers, web servers, and operating systems, and because of this, a 502 bad gateway error can show up in many different ways.

Here are the various variations of 502 Bad Gateway:

  • 502 Bad Gateway
  • 502. That’s an error
  • 502 Proxy Error
  • 502 bad gateway Cloudflare
  • 502 Service Temporarily Overloaded
  • 502 Server Error: The server encountered a temporary error and could not complete your request
  • A blank white screen
  • Bad Gateway: The proxy server received an invalid response from an upstream server
  • HTTP Error 502 – Bad Gateway
  • Temporary Error (502)

HTTP Error 502 Bad Gateway Root Causes

The reasons behind a 502 Bad Gateway Error can vary:

  • Server Overload

This happens when the server runs out of resources and crashes, leading to a 502 error. This could be due to a sudden increase in traffic or low memory.

  • Browser Issues

If your browser version is outdated or there are corrupted files in your browser cache, this could cause a 502 error.

  • Network Problems

Sometimes, there could be network issues between the two servers, and it’s just a temporary problem.

  • Firewall or Coding Errors

If there’s an improperly configured firewall or a coding error, the problem won’t get fixed until those issues are addressed.

How to Fix HTTP 502 Bad Gateway Error?

HTTP Error 502 Bad Gateway

A 502 bad gateway error usually means there’s a network or server issue. But sometimes, the problem can be on your end. Let’s look at both possibilities.

Here are some common solutions to fix the 502 bad gateway error :

Solution 1: Refresh the Page

The issue might be temporary, even if the error is on the server, and a simple refresh might solve the problem.

Try reloading the page by pressing  F5  or clicking the refresh button.

If the website administrator rectifies the issue promptly, refreshing the webpage might eliminate the error.

Solution 2: Check if the Site Is Down for Others

If the site is down for everyone, you’ll have to wait for the site owners to fix the issue.

Solution 3: Try a Different Browser

If the problem persists in one browser, try using another one.

Accessing the website through an alternate browser can assist in identifying whether the issue originates from your browser, your device, or the website’s servers.

Solution 4: Clear Your Browser’s Cache and Cookies

Old or corrupted cache and cookies can sometimes cause a 502 Bad Gateway Error .

This can help clear out any old or corrupted data that might be causing the problem.

When you clear them, you get new info from the website’s server.

If you use Google Chrome, here’s how to clear its cache:

  • Click the three dots in the top-right corner of your window. You can also use the keyboard shortcut (Ctrl + H).
  • Go to History History.
  • Click on Clear Browsing Data.

Clear browsing data

  • A new window will appear. Choose the Time range, if you wish to erase all data, select All Time.

Choose the Time range

  • Select what you’d like to clear- this could be browsing history, cookies, and other site data, or cached images and files.
  • Then, hit the  Clear Data  button.

Solution 5: Try to Use Incognito

You can try to open the site in incognito mode. If you don’t see the 502 error , maybe a browser extension is causing it.

To find out which extension is causing the problem, turn them off one by one.

After each one, see if the website opens.

When the website opens, you’ve found and removed the extension that was causing the problem.

Solution 6: Check Your Plugins and Extensions

Sometimes, browser plugins and extensions can cause problems.

Disabling them can help identify if they are the cause.

Solution 7: Restart Your Devices

Restarting your computer and networking equipment can sometimes resolve the issue.

Solution 8: Verify Your DNS

A 502 gateway error might happen because of a problem with the DNS, like the domain not linking to the right IP, or the DNS server not answering.

If you’ve just moved your site to a new host, you need to wait for everything to update, which can take up to a day. This depends on the TTL value of your DNS records.

You could also try clearing your local DNS cache. This is like clearing out your browser’s saved data.

If the operation was successful, you’ll see a message stating “Successfully flushed the DNS resolver Cache”.

safari bad gateway 502

Solution 9: Disable your Browser Extensions

Some extensions can interfere with how your browser caches web pages.

To address this issue, you should deactivate your browser’s extensions.

The procedure differs for each browser, so here’s a guide for four primary browsers –  Google Chrome ,  Mozilla Firefox ,  Safari , and  Microsoft Edge .

Chrome Extensions:

  • Proceed to Settings

safari bad gateway 502

  • Then click -> Extensions.
  • On the Extensions page, deactivate each extension by clicking on their respective toggle switches.

For instance:

safari bad gateway 502

If you wish to get rid of unused or old extensions, press the  “Remove”  button.

Mozilla Firefox Extensions

If Firefox is your preferred browser, here’s how you can disable and re-enable extensions:

  • Click the trio of lines in the top right corner of the browser.
  • Select “Add-ons.”
  • Choose “Extensions” from the left-hand menu.
  • In the “Enabled” section, click the three dots next to a browser extension and select “Disable.”
  • Repeat this for all browser extensions.
  • To reactivate browser extensions, navigate to the “Disabled” section. Click on the three dots next to a browser extension and select “Enable.”
  • To delete extensions, click on the three dots and choose “Remove.”
  • Confirm the deletion by clicking “Remove” in the pop-up box.

Internet Explorer Extensions:

If you’re an Internet Explorer user, here’s how you can disable and re-enable extensions:

  • Click the gear symbol in the top right corner of the browser.
  • Choose “Manage add-ons.”
  • Select “Toolbars and Extensions” from the left-hand menu.
  • Click on a browser extension, select “Disable” in the bottom right corner, and confirm by clicking “Disable” in the pop-up box. Repeat this for all browser extensions.
  • To reactivate an extension, click on it, select “Enable” and confirm by selecting “Enable” again.
  • To remove faulty extensions, go to your computer’s “Control Panel” > “Programs” > “Programs and Features.”
  • Right-click on the extension you want to delete, click “Uninstall” and confirm by clicking “Yes.”

Safari Extensions:

If you’re a Safari user, here’s how you can disable and re-enable extensions:

  • Click “Safari” in your toolbar.
  • Select “Preferences.”
  • Navigate to the “Extensions” tab.
  • Deselect the boxes next to all extensions to disable them.
  • To reactivate extensions, select the boxes next to each one.
  • To delete a faulty extension, click on the extension and select “Uninstall.” Choose “Show in Finder,” right-click on the extension, select “Move to Bin” and empty your computer’s trash folder.

Solution 10: Contact Your Host

If you’re seeing 502 Bad Gateway on your own site, it’s worth reaching out to your hosting provider for assistance.

The HTTP Error 502 Bad Gateway occurs when the server receives an incorrect response from another server, or when a gateway server is unable to establish communication to complete the request.

This error does not indicate that there’s a problem with your device or with your internet connection.

This error originates from the server.

Remember, most of the time, this is just a server-side error that you can’t do much about. But trying the solutions provided above will help you get back on track.

I hope this article helps you rectify this error.

For further learning, you can also check the following HTTP status code:

  • HTTP Status Code 429
  • HTTP Status Code 431
  • HTTP Status Code 451
  • HTTP Status Code 500
  • HTTP Status Code 501

Leave a Comment Cancel reply

You must be logged in to post a comment.

What Is Error 502 and How Do You Solve It?

The 502 Bad Gateway Error and How To Resolve It.

You’ll face plenty of errors with your WordPress website, but none as common as the 502 error. Surprisingly, even big tech companies like Google, Facebook, and Twitter sometimes face it.

With that in mind, how do you resolve a 502 error on your WordPress website?

Although it's easy to identify a 502 error, troubleshooting it is not that simple unless you understand what caused it. Read more to discover:

What Is Error 502?

Causes of error 502, how to fix the 502 bad gateway error on your wordpress website, how to prevent future 502 bad gateway errors on your website, final thoughts: the 502 bad gateway error and how to resolve it.

A 502 HTTP status code is a response code that shows your server received an invalid response from an upstream server. Your native Microsoft and Mac browsers, including different browsers like Google Chrome, Firefox, and Safari, will display this error in several ways.

Here are five common examples:

  • “502 Bad Gateway”
  • “502 service temporarily overloaded”
  • “HTTP Error 502 – Bad Gateway”
  • “502 Proxy Error”
  • “502 bad gateway Cloudflare”

Sometimes, this error may also appear as a blank white screen without an error code displayed. However, the essential thing to look out for is the error code itself, not the text variations around it.

The error code helps you identify and troubleshoot any problems with your website.

Here are some causes for an Error 502 on your WordPress website:

Unresponsive Servers

Sometimes, web servers fail, leading to downtime. It can affect single or multiple websites within one server.

These are often unplanned, and your hosting provider may be unaware of them. Other times, you may have a bad modem, router, or networking equipment. That means your commands won’t reach the server.

Massive Traffic

If your website receives massive traffic, this can overload your server and cause it to throw a 502 bad gateway error. That often happens to websites on shared servers.

If you migrate your website from one host to another, propagating your domains to a new host may take time. Before your domain resolves to your new DNS servers, your website may display a 502 error.

Your firewall configuration could cause your website to throw a 502 error. Although not common, that may happen if you configure your firewall improperly. That also happens if your third-party content delivery network (CDN) goes offline.

Corrupted Files and Code

If your active themes and plugins contain corrupt PHP scripts, they can cause your site to break. Also, nulled themes and plugins with malicious code can cause your website to throw an HTTP error 502.

Database Errors

If your database has errors, your website may have problems accessing essential data. Any requests you make for information may return an invalid response error in this case.

Because of the ambiguous nature of a 502 bad gateway error, you may not have a solution right away. Still, here are some potential actions you can take to resolve this problem:

Check for Server Connection Issues

One major cause of the 502 bad gateway error is server downtime or connection issues. These tend to stem from:

Maintenance and Upgrades

Your hosting provider may take your server down as part of a systemwide upgrade. Whenever this happens, it affects many users at once.

If you’re facing downtime because of server-side maintenance, wait until your host completes that process.

Most hosting providers expedite the process to reduce your risk of loss. They also notify you of upcoming service interruptions by email. Stay up to date with your emails and messages to prepare for downtime beforehand.

System Overloads

Another reason your server may have an internal server error is a server overload. This problem is quite common with shared hosting. If you’re on a shared plan, an uncontrolled process or plugin may use up all your server resources.

If the overload is temporary, the problem usually resolves itself. But if the overload persists, your hosting provider may suspend the problematic user account. Doing so restores the server’s health and prevents other websites from experiencing downtime.

Should your host suspend your account , customer support will contact you with instructions to resolve issues on your website backend. Once you resolve these client-side issues, your host will restore your account.

Check Your Themes and Plugins

Third-party themes and plugins can cause your site to throw a temporary error. Errors are commonly triggered by:

If you’re using third-party plugins to enhance the functionality of your WordPress site, make sure they stay up to date . Also, ensure that any dependent themes and the WordPress core are up-to-date.

Most times, updates patch vulnerabilities in your core, themes, and plugins. They also enhance and improve all the current features and functionality you enjoy. Failing to update your WordPress assets can cause downtime for your website.

However, complex update issues can also arise after updating plugins.

Developers often enhance their plugins and themes with new features and functionality, meaning updates can also break your site.

To verify if a plugin is causing problems, deactivate it. Here’s how:

1. Access your WordPress backend.

WordPress Updates Page.

2. From the Dashboard Menu , select Plugins .

WordPress Plugins Page.

3. From the Bulk Actions dropdown menu, select Deactivate .

WordPress Plugin Deactivate Page.

If the deactivated plugin was responsible for the 502 bad gateway error, following the above steps should restore access to your webpage or site. If not, you can continue to search for the problematic plugin by process of elimination.

To do that, activate one plugin at a time while refreshing your website after each reactivation. If you reactivate a plugin and receive a 502 bad gateway error, it means you found the culprit. From here, keep that plugin deactivated and contact its developers for a solution.

Plugin Conflicts

If two plugins perform the same function, they may clash and cause 502 bad gateway errors. One plugin may attempt to override others, causing other plugins to break. Also, it may cause your custom theme or WordPress core to malfunction.

Here are several ways to resolve this problem:

  • To resolve plugin conflicts , you can use the elimination process above to identify and disable them.
  • Also, check for error messages on your plugin page or WordPress dashboard. If one core plugin deactivates another, a warning banner appears at the top of your dashboard with recommended fixes.
  • Avoid installing over one plugin with similar functionality. Since these plugins compete, they may use up resources or break your website altogether.
  • Update a plugin at a time to identify potentially problematic plugins ahead of time.
  • Uninstall all unnecessary themes and plugins from your WordPress website.

Nulled Themes and Plugins

Nulled themes and plugins are premium WordPress assets changed or hacked to work without license key activation. Some usually contain malicious code that may harm your website or collect data without your permission.

Most nulled plugins are free or sold at much lower prices and won’t come directly from the developer.

Because of the security threats posed by some nulled WordPress themes and plugins, your website may break and display a 502 bad gateway error. Most nulled assets don’t support updates. Updates override any hacked or modified code and reset the plugin.

If you’re using any nulled themes or plugins, deactivate them. Doing this resolves any server connection issues your website may be facing. If you prefer to continue using these assets, please buy them from their rightful owners.

That gives you access to support services and automatic updates.

Check Your Website Error Logs

You can take advantage of the WordPress debugging system to discover and resolve error messages. Once you access these logs, you can find out what caused your website to fail and throw a 502 bad gateway error.

To access your error logs:

  • Use an FTP file manager . You can also use the file manager option inside your Web hosting control panel.
  • Navigate to the /wp-content/ folder.
  • Select and download the debug.log file.

Once downloaded, open it and read through it for any recent error messages that may explain the 502 bad gateway error. Once you find a specific error, note down its details. The information can help you find a solution across WordPress forums and communities.

DNS Changes

If your domain name cannot resolve to the correct IP address, your DNS server will not respond. That throws a 502 bad gateway error. You’ll often face this challenge if you’ve migrated to a new hosting service. If that’s the case, your domain may not have fully propagated to your new host.

Full propagation usually takes between an hour and 24 hours, so you’ll have to be patient.

If that doesn’t work, you can also temporarily change your DNS servers. Although your internet Service Provider (ISP) automatically allocates DNS servers, you can still use a public DNS server. Google public DNS servers are a great example, and some users prefer them long-term.

You can also clear your server error by clearing out your DNS cache. Cleaning your browser cache also helps.

Firewall Configuration

Your WordPress firewall is your first line of defense from distributed denial of service (DDoS) attacks, malware, and hacks. If your firewall is configured incorrectly, it may interpret traffic from your content delivery network (CDN) as an attack and block it. Such a block can cause your website to throw a 502 bad gateway error.

To troubleshoot this issue:

  • You can disable your firewall temporarily.
  • If you’re using a third-party CDN , contact them for further help.

Contact Your Host

If all else fails, or you’d rather leave it to an expert, you can give your hosting provider a call . A customer service agent will log your issues, and an expert will address them.

Customer Support for Error 502 on your WordPress Website.

Sometimes, a 502 bad gateway error stems from issues with your hosting partner. If so, they’ll resolve the issue promptly. If the issue is unique to your website, the customer support agent will walk you through a solution.

Here are some actions you can take to reduce the risk of future 502 bad gateway errors on your website:

Ensure Your WordPress Core, Themes, and Plugins are Up to Date

Always keep your themes, plugins, and WordPress core up to date. Doing so ensures you keep your website healthy and helps patch vulnerabilities. If your digital assets stay updated, you won’t experience avoidable website breakdowns or error codes.

Always Check Your Site’s Health

Site Health Page.

Whenever you access your WordPress backend, make sure you check for the health status of your website. This feature gives you information about the configuration of your website and recommends actions you should take to keep your site secure.

By following the recommendations made by the Site Health feature, you’ll keep your site running seamlessly, free of errors.

Never Directly Edit Theme or Plugin Files

Unless you’re an experienced developer or have a clear idea of what you’re doing, never directly edit your theme or plugin files. Adding untested code to your website’s PHP files can break your website entirely, and you may lose access to your backend in certain cases.

Let an Expert Manage Your Website

You can avoid the hassle of fixing errors and other website problems by letting WordPress experts manage your website. Some experts even offer hosting plans to give you a reliable way to avoid hosting-side issues.

Solving a 502 bad gateway error on your website is essential. The longer you stay offline, the more it costs you and your business. If you face this challenge, ensure you solve it fast to minimize the impact.

You can use any of these solutions above to resolve your WordPress website issues. If you still feel stuck, contact your website host and request assistance.

If you would rather have someone else handle the technical aspects of your website as you focus on growing your business, check out Nexcess’s Fully Managed WordPress Hosting plans today and choose a plan that fits your needs.

This blog was originally published in November 2020. It has since been updated for accuracy and comprehensiveness.

Maddy Osman

Maddy Osman is a WordPress expert, WordCamp US speaker, bestselling author, and the Founder and SEO Content Strategist at The Blogsmith. She has a B.A. in Marketing from the University of Iowa and is a WordCamp Denver organizer while also operating The Blogsmith, an SEO content agency for B2B tech companies that works with clients like HubSpot, Automattic, and Sprout Social. Learn more about The Blogsmith's process and get in touch to talk content strategy: www.TheBlogsmith.com

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

GitHub Community

502 bad gateway error on almost every action. when creating a classroom, updating a roster, or creating an assignment #114575.

@grentank

grentank Mar 28, 2024

Beta Was this translation helpful? Give feedback.

Replies: 4 comments

This comment was marked as off-topic., dordle12 mar 30, 2024, daniel-hasan mar 30, 2024, lyannabueno mar 30, 2024.

@grentank

  • Numbered list
  • Unordered list
  • Attach files

Select a reply

Ask a question

Start a discussion.

  • Jira Jira Software
  • Jira Service Desk Jira Service Management
  • Jira Work Management
  • Confluence Confluence
  • Trello Trello

Community resources

  • Announcements
  • Technical support
  • Documentation

Atlassian Community Events

  • Atlassian University
  • groups-icon Welcome Center
  • groups-icon Featured Groups
  • groups-icon Product Groups
  • groups-icon Regional Groups
  • groups-icon Industry Groups
  • groups-icon Community Groups
  • Learning Paths
  • Certifications
  • Courses by Product

questions

Get product advice from experts

groups

Join a community group

learning

Advance your career with learning paths

kudos

Earn badges and rewards

events

Connect and share ideas at events

  • Discussions

Confluence Error 502 Bad Gateway

Luis Andino Rodriguez

Was this helpful?

  • confluence-cloud
  • Community Guidelines
  • Privacy policy
  • Notice at Collection
  • Terms of use
  • © 2024 Atlassian

IMAGES

  1. 502 Bad Gateway Error and How to Fix It

    safari bad gateway 502

  2. What is 502 Bad Gateway on Mac/Windows & How to Fix it?

    safari bad gateway 502

  3. 502 Bad Gateway (What It Is and How to Fix It)

    safari bad gateway 502

  4. What Is a 502 Bad Gateway Error (And How Can You Fix It)?

    safari bad gateway 502

  5. 502 Bad Gateway Explained: What it is and How Can I fix it?

    safari bad gateway 502

  6. 502 Bad Gateway: What It Is & How to Fix It

    safari bad gateway 502

VIDEO

  1. bandicam 2024 01 29 14 15 26 316

  2. حل مشكلة BAD GATEWAY 502 علی متصفح جوجل كروم

  3. Safari vehicle helps van to escape from elephant #wildelephants #elephantattack #jungleelephant

  4. What Does 502 Bad Gateway Mean

  5. 502 bad gateway |JPSC ADMIT CARD DOWNLOAD 2024| ❌

COMMENTS

  1. How To resolve a 502 bad gateway error?

    There are numerous strategies are accessible on the web to determine 502 bad gateway issue, probably the most effortless techniques are referenced here: Refresh your web page- This is one of the fundamental strategies which works for the majority of the errors on your browsers. Here and there your browser won't react as it gets a weight with ...

  2. 502 Bad Gateway Error: What It Is and How to Fix It

    502 Bad Gateway errors are usually caused by two different internet servers that are having trouble communicating. Here is what to do. ... Edge, Opera, and Safari. If an alternative browser doesn't produce a 502 Bad Gateway error, you now know that your original browser is the source of the problem. Assuming you've followed the above ...

  3. What is a 502 Bad Gateway Error (And How Can I Fix It)?

    Change your DNS Servers Sometimes, DNS problems can cause 502 errors. Changing your DNS servers is not a likely fix, but it is a possible one.

  4. 10 Ways to Fix 502 Bad Gateway Errors on a Mac

    Refresh the page. Sometimes 502 errors resolve on their own. In many cases, it is enough to simply wait a few minutes, then reload the page. Hit your browser's Refresh button, which is located near the address bar on most browsers. Or, use the keyboard shortcut command + R .

  5. Why am I getting the message 502 Bad Gate…

    502 bad gateway I get the message "502 Bad Gateway" when I start a new tab in safari and enter search criteria into the web address bar. I am sometimes only able to access my saved web pages. NSPOSIXErrorDomain:40 It is from 2 days that some web pages (in particular Google.it) do not load, instead a white page appears with this error: "Safari ...

  6. 502 Bad Gateway-Safari error whe using se…

    502 bad gateway I get the message "502 Bad Gateway" when I start a new tab in safari and enter search criteria into the web address bar. I am sometimes only able to access my saved web pages. I am sometimes only able to access my saved web pages.

  7. How To Fix 502 Bad Gateway Error

    Apple Safari; Microsoft Edge; Tor; Cheat Sheets. HTML Cheat Sheet; CSS Cheat Sheet; JavaScript Cheat Sheet; React Cheat Sheet; Angular Cheat Sheet; jQuery Cheat Sheet; ... 502 Bad Gateway at Cloudflare: Whenever your website, acting as a reverse proxy through a content delivery network (CDN) called Cloudflare, runs an invalid response from your ...

  8. How To Fix a 502 Bad Gateway Error (13 Quick Fixes)

    The 502 (Bad Gateway) status code indicates that the server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.

  9. 502 Bad Gateway Error: What It Is and How to Fix It

    If you're using Windows, you can flush the DNS cache using the Command Prompt. To access it, type "CMD" into the Windows search on your taskbar, and press Enter. You'll now have access to your Command Prompt. Once the Command Prompt box is open, copy or type the following command: ipconfig /flushdns. Let it run.

  10. What Is a 502 Bad Gateway Error (And How to Fix It)

    Refresh the Page. If you're faced with a 502 error, the first thing you should do is to refresh the web page. Most errors like this happen either because there's a temporary network issue somewhere down the line or because the server is overloaded.

  11. 502 Bad Gateway Error: What It Is and How to Fix It

    Other common causes of 502 Bad Gateway are DNS problems, such as incorrect IP addresses and unresponsive DNS servers. In this case, flushing your DNS cache can be the answer. This method works similarly to clearing your browser's cache. It will remove faulty files from your DNS server.

  12. What is 502 Bad Gateway on Mac/Windows & How to Fix it?

    Usually, 502 Bad Gateway is the result of the server error, which means the server you trying to access is not accessible or down. Now, you can use the following ways to fix 502 Bad Gateway on Mac or Windows. Refresh the page. Refresh the browser is always worth a shot. Sometimes, the 502 Bad Gateway is just temporary, and refreshing the ...

  13. What is 502 bad gateway and how do you fix it?

    1. Refresh your browser. It sounds too simple, but in some cases where the server is overloaded with requests, sending a few more requests by refreshing the browser a few times can sometimes help reset the connection between the device and server, allowing you to resume browsing. 2. Clear your browser's cache.

  14. What is a 502 Bad Gateway Error and How to Fix It

    These just list the errors your website experiences, but unlike the 502 Bad Gateway error, these are easier to pinpoint the cause. How you access them changes depending on your web host. For GreenGeeks customers, simply log into the cPanel , and view the Errors in the Metrics sections .

  15. 502 bad gateway: What it means & how web developers can fix ...

    What to do if you see a 502 bad gateway page when browsing. If you are browsing the internet and receive a 502 bad gateway page, you can try a few techniques to fix it on your end.

  16. How to Fix 502 Bad Gateway Error?

    The "502 Bad Gateway" error, much like other connection errors, can occur on any device, any browser or any application that connects to the internet. ... Fix Safari Slow Loading Pages in macOS; Fix Windows WiFi Connection Issue; ROYGBIV or VIBGYOR Rainbow Color Codes;

  17. NGINX Error: 502 Bad Gateway

    Through careful monitoring and proper server configuration, 502 Bad Gateway errors can be avoided, providing a stable and responsive experience for users. Conclusion. Understanding the causes of NGINX 502 Bad Gateway errors is half the battle. With careful configuration, monitoring, and server management, you can ensure your sites remain online ...

  18. 502 Bad Gateway

    Go to "Develop" then "Empty Caches." 502 Bad Gateway in NGINX. PHP-FastCGI Process Manager (PHP-FPM) is a background process for handling web server requests for PHP apps.

  19. HTTP Error 502 Bad Gateway: What it Means and How to Fix it?

    Click the three dots in the top-right corner of your window. You can also use the keyboard shortcut (Ctrl + H). Go to History History. Click on Clear Browsing Data.

  20. 6 Ways To Fix 502 Bad Gateway In Nginx

    Can too much traffic cause a 502 Bad Gateway? Too much traffic can overwhelm the backend servers or the proxy infrastructure, causing the 502 Bad Gateway problem. In these situations, you may need to optimize your server resources, change timeouts, or use load balancers to handle the extra traffic. Q. Can DNS problems result in a 502 Bad ...

  21. The 502 Bad Gateway Error and How To Resolve It

    3. From the Bulk Actions dropdown menu, select Deactivate. If the deactivated plugin was responsible for the 502 bad gateway error, following the above steps should restore access to your webpage or site. If not, you can continue to search for the problematic plugin by process of elimination.

  22. 502 Bad Gateway Error on almost every action. When creating a ...

    Hi everyone, Third day in a row I experience 502 Bad Gateway Errors in github classroom. I've been using Github Classroom for a couple of months and had no issues whatsoever. Now I get the 502 ...

  23. Confluence Error 502 Bad Gateway

    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.