Fix 502 Error
Fix 502 Error

How to Fix 502 Bad Gateway Error

Introduction to 502 bad gateway error

We noticed that when a user visits a website it forwards a request to a web server. The origin server gets data and sends back the browser. The web server collects then prepares the request and transfers back the requested device HTTP status code. It’s the server’s way of informing that something has gone wrong with the request. 

Below are many different types of 502 error around the internet:

  • Error 502
  • 502 error
  • HTTP 502
  • 502 service temporarily overloaded
  • 502 bad gateway NGINX

How to Fix the 502 Bad Gateway Error

Step 1 :

Try Reloading the Page

One of the simplest steps you have to try is to reload the page. You can reload the website doing this simple step (F5 or Ctrl + R). There are chances that the origin server is overloaded and the website will come right back after some time. 

Step 2:

Check website is live for others

Check if a website or service is down or having problems. There is a reference website that informs you if the website is down or it is a problem on your side (Client).

Step 3 :

Clear Your Browser Cache

Did you know every time you visit websites then your browser saves certain data in the temporary storage?

Below is an instruction to clear cache

  • Press Ctrl + H
  • on the left side find ( Clear Browsing Data)
  • Select “All Time” from Time Range to clear your entire cache. 
  • Select Cache: 
  • Exit/quit the browser and re-open the browser. 

Step 4 :

DNS Issue

There are chances that A 502 gateway error occurs because of a DNS issue. Below is the instruction to clear DNS issue :

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

  • Press CTRL +R and paste this code (ipconfig /flushdns)

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

Step 5:

Check With Your Host

There are chances that the problem also with the webserver. We examine many times the script or request will take too long and so it is canceled by the server. 

Step 6:

Contact the Website Administrator

There are reasons that this issue is also caused by these reasons. 

  • Check Your Plugins and Themes
  • Restart PHP
  • PHP Timeout Issue

If the above fixes did not work for you. Theirs another way to fix that all you need to just contact the website administrator by contacting him/her through their contact page. or you can simply write a mail for the website administrator.

Read Also:-How to Fix Error 500 Internal Server

Final Words

The solutions provided by us in this article are easy to implement by anyone who has a basic knowledge of computers. If you are still facing the issue simply write a comment below so we can help you to fix that problem.