{"id":17058,"date":"2021-05-06T16:00:30","date_gmt":"2021-05-06T16:00:30","guid":{"rendered":"https:\/\/10web.io\/blog\/?p=17058"},"modified":"2026-03-12T17:58:38","modified_gmt":"2026-03-12T17:58:38","slug":"502-bad-gateway","status":"publish","type":"post","link":"https:\/\/10web.io\/blog\/502-bad-gateway\/","title":{"rendered":"502 Bad Gateway Error and How to Fix It"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">HTTP 504 Gateway Timeout and HTTP 502 Bad Gateway errors are the most common server errors for WordPress website visitors and owners. In my previous article, we discussed the causes of a <\/span><a href=\"https:\/\/10web.io\/blog\/504-gateway-timeout-error\/\"><span style=\"font-weight: 400;\">504 Gateway Timeout<\/span><\/a><span style=\"font-weight: 400;\"> error and possible solutions. In this article, we\u2019ll come to understand what a 502 Bad Gateway error is, talk about the reasons for a 502 Bad Gateway error, and explore some tips for troubleshooting this type of error.<\/span><\/p>\n\r\n<style>\r\n  #ctablocks_inline_90{\r\n          background-color: #000000;\r\n        color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_inline_90 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_inline_90 .button{\r\n        background-color: rgb(51,57,241);\r\n      color: #ffffff;\r\n    border-color: #3339f1 !important;\r\n  }\r\n  #ctablocks_inline_90 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n        #ctablocks_inline_90 .ctablocks_content_info p {\r\n        padding-left: 36px;\r\n      }\r\n      #ctablocks_inline_90 .ctablocks_content_button {\r\n          margin-left: 37px;\r\n      }\r\n  @media screen and (min-width: 768px) and (max-width: 1260px) {\r\n      #ctablocks_inline_90 .ctablocks_content_button {\r\n          margin-left: 37px !important;\r\n      }\r\n  }\r\n  ;\r\n<\/style>\r\n<div id=\"ctablocks_inline_90\" class=\"ctablocks_container inline_type\r\n        \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n      \r\n            <div class=\"title-wrap\">\r\n\t\t\t\t\t                  <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/info-icon-cta.png\" alt=\"Say goodbye to website errors\" title=\"Say goodbye to website errors\">\r\n\t\t\t\t\t            <h4>Say goodbye to website errors<\/h4>\r\n        <\/div>\r\n              <p>Achieve peace of mind with 99.99% uptime on 10Web Managed <br>WordPress Hosting, powered by Google Cloud. <\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/ai-website-builder\/\" class=\"button\" data-gtag=\"sign-up-blog\" data-buttontype=\"sign-up\" data-gtag=\"cta-90\" data-buttontype=\"cta-inline\"\r\n\t        >Learn How<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <\/div>\r\n\n<h2 id=\"faqs\">FAQ<\/h2>\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">What is the difference between a 404 error and a 502?<\/p>\n    <div class=\"faq_content\"> A 404 Not Found error occurs when content can&#8217;t be found by the web server. A 502 Bad Gateway error happens when the proxy server can&#8217;t get any response or gets an invalid response from the upstream server. You come across 404 when requested content was removed or doesn\u2019t exist. You see 502 errors when there is an issue with the upstream or origin server or a communication issue between proxy and upstream servers. <\/div>\n<\/div>\n\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">What is the difference between 502, 503, and 504 error messages on websites?<\/p>\n    <div class=\"faq_content\"> You got a 502 Bad Gateway error when the proxy server doesn\u2019t get a valid response from the upstream or origin server. 504 Gateway Timeout error happens when the server which is acting as a proxy server can\u2019t receive a timely response from the upstream server. 503 Service Unavailable error indicates that the server is not ready to handle the request, this happens when the server is down for maintenance or is overloaded. <\/div>\n<\/div>\n\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">Do 502 errors have any impact on website rankings?<\/p>\n    <div class=\"faq_content\"> The 502 Bad gateway error can have a major impact on website rankings. You don&#8217;t have to worry about a negative impact on SEO if the error lasts a few minutes. If the page is being crawled during this time, the crawler can load it from the cache. But you do need to worry if this error lasts for a few hours. In that case, Google will see the 502 error which can negatively impact your rankings. <\/div>\n<\/div>\n\n<div class=\"faq-shortcode\">\n    <p class=\"faq_title\">What can I do when PHP is working in the command line but returns a 502 error in the browser?<\/p>\n    <div class=\"faq_content\"> 502 error happens because of bad communication between proxy and upstream servers. When you&#8217;re running PHP in the command line you don\u2019t need a web server, PHP works for you directly. To find out the reasons for 502 errors, read the above-described tips. <\/div>\n<\/div>\n\n<h2 id=\"what-does-502-bad-gateway-mean\"><b>What does 502 Bad Gateway mean?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Before we define a 502 Bad Gateway error, let\u2019s deep-dive into server infrastructure and find the meaning of some terms, like web server, proxy server or gateway, and upstream server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s first discuss how hosting a modern web application works. We need three actors for this:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The web application<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The gateway<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The web server<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">In the picture below you can see the PHP modern web application workflow.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/1.jpg\" alt=\"web application workflow\" width=\"1484\" height=\"832\" class=\"alignnone size-full wp-image-17068\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/1.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/1-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/1-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/1-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/1-371x208.jpg 371w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><\/p>\n<p><span style=\"font-weight: 400;\"> <\/span><span style=\"font-weight: 400;\"> A web application is software that can be coded in different programming languages and can use specific frameworks or libraries. It typically has tools to handle HyperText Transfer Protocol (HTTP) requests. For your WordPress website, the web application is your WordPress installation, which is coded in PHP.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The gateway sits between a web server (Nginx, Apache) and a web application. It accepts requests from a web server and translates them for a web application. The exact definition of a gateway is fluid. Some call themselves process managers, and some call themselves HTTP servers.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s what the common functionality of a gateway entails:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Listening for requests (HTTP, FastCGI, uWSGI, and more)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Translating requests to application code<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Spawning multiple processes and\/or threads of applications<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Monitoring spawned processes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Loading balance requests between processes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Reporting\/logging<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">PHP-FPM (PHP-FastCGI Process Manager) is the gateway for PHP. It is an implementation of FastCGI and will listen for FastCGI requests from a web server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">FastCGI is a binary protocol for interfacing interactive programs with a web server. CGI (Common Gateway Interface) is a web technology and protocol that describes how a web server can communicate with external applications, e.g., PHP. CGI is an interface between the web server and the dynamic web content generated by web applications written in different programming languages, such as PHP and Python. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">FastCGI is an improved version of CGI.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A modern way to run PHP applications is to use PHP-FPM. Before PHP-FPM, PHP was commonly run directly in Apache. There was no need for a gateway. Apache\u2019s PHP module loaded PHP directly, allowing PHP to be run in line with any processed files.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The web server generally hosts multiple sites, serves static files, proxies requests to other processes, and performs load balancing and HTTP caching. The most popular web servers are Apache and Nginx. Apache was the most widespread web server until Nginx became more popular.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">At 10Web, we support the LEMP stack, which is similar to LAMP (Linux, Apache, MySQL, and PHP), except Nginx replaces Apache. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">What happens when you open your WordPress website hosted by 10Web in your browser? The web server, in this case, Nginx, accepts a request and relays it to PHP-FPM, which in turn interprets the PHP code. The response is relayed back, finally reaching the client.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In this case, Ngnix acts like a proxy server, which is usually called an edge server. The server behind the proxy server is called the upstream or origin server. In this case, PHP-FPM acts as an upstream server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now that we fully understand the terms mentioned above let\u2019s finally understand the 502 Bad Gateway error.<\/span><\/p>\n<h2 id=\"what-is-a-502-bad-gateway-error\"><b>What is a 502 Bad Gateway error?<\/b><\/h2>\n<p><b>We face a 502 Bad Gateway error when the web server acts as a proxy server and receives an invalid response from the upstream server.<\/b><span style=\"font-weight: 400;\"> A 502 Bad Gateway error indicates that the proxy server, which is the edge server, could not get a valid response from the upstream server, which is the origin server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When you see a 502 Bad Gateway error, it means that something is wrong with the upstream server. The server notifies you with an HTTP status code, such as a 502 bad gateway error, indicating the nature of the problem.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A 502 error is part of a series of 500 status error codes (500, 501, 502, 503, 504, 508, 520, etc.) that indicate different server-side issues preventing the fulfillment of the request.<\/span><\/p>\n<h2 id=\"the-various-forms-of-502-errors\"><b>The various forms of 502 errors<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">A 502 Bad Gateway error can appear differently depending on the operating system, web browser, and device. <\/span><span style=\"font-weight: 400;\">Each combination can interpret and display the error uniquely, though the underlying issue is the same. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s how it looks most of the time:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/2.jpg\" alt=\"502 bad gateway error\" width=\"1484\" height=\"832\" class=\"alignnone size-full wp-image-17067\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/2.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/2-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/2-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/2-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/2-371x208.jpg 371w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Users might encounter several distinct messages, each a variation of the 502 error, such as:<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 Bad Gateway<\/span><\/i><span style=\"font-weight: 400;\">: the most common variation.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">Error 502<\/span><\/i><span style=\"font-weight: 400;\">: A simplified version often used by various browsers.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">HTTP Error 502 \u2013 Bad Gateway<\/span><\/i><span style=\"font-weight: 400;\">: A more descriptive version, typically seen in browsers with detailed error reporting.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 Service Temporarily Overloaded<\/span><\/i><span style=\"font-weight: 400;\">: Indicates server overload, common in high-traffic scenarios.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 Proxy Error<\/span><\/i><span style=\"font-weight: 400;\">: Seen in environments where proxy servers are used.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A blank white screen: A less informative variant, sometimes due to the server\u2019s or browser\u2019s minimalistic error handling.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 Server Error: The server encountered a temporary error and could not complete your request.<\/span><\/i><span style=\"font-weight: 400;\">: This detailed message provides insights into the problem\u2019s temporary nature.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">HTTP 502<\/span><\/i><span style=\"font-weight: 400;\">: A concise version common in various web applications.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">Temporary Error (502)<\/span><\/i><span style=\"font-weight: 400;\">: This signifies the temporary aspect of the error.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502. That\u2019s an error<\/span><\/i><span style=\"font-weight: 400;\">: A user-friendly variant, often accompanied by additional instructions, as seen with Google\u2019s services.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 bad gateway Cloudflare<\/span><\/i><span style=\"font-weight: 400;\">: Specific to Cloudflare services, indicating issues with the Cloudflare network.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">Bad Gateway<\/span><\/i><span style=\"font-weight: 400;\">: The proxy server received an invalid response from an upstream server.\u201d This detailed description is often seen in environments with multiple server layers.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 server error<\/span><\/i><span style=\"font-weight: 400;\">: Another general form of the error message.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">502 \u2013 Web server received an invalid response while acting as a gateway or proxy server<\/span><\/i><span style=\"font-weight: 400;\">: This version provides a comprehensive explanation, indicating the server\u2019s role and the nature of the issue.<\/span><\/p>\n<h3 id=\"custom-502-pages\"><span style=\"font-weight: 400;\">Custom 502 pages<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Some services and sites customize their 502 error messages for user-friendliness.<\/span><span style=\"font-weight: 400;\"> <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Google presents a message such as <\/span><i><span style=\"font-weight: 400;\">502. That\u2019s an error. The server encountered a temporary error and could not complete your request. Please try again in 30 seconds. That\u2019s all we know\u2014<\/span><\/i><span style=\"font-weight: 400;\">combining error information with a user action suggestion.<\/span> <span style=\"font-weight: 400;\"> <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/3.jpg\" alt=\"Google 502 Bad Gateway error\" width=\"1484\" height=\"832\" class=\"alignnone size-full wp-image-17066\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/3.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/3-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/3-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/3-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/3-371x208.jpg 371w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Twitter might display a message like \u201cTwitter is over capacity,\u201d a more user-centric way of communicating the issue.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/twitter-custom-502-errror.jpg\" alt=\"Twitter's custom 502 bad gateway error page.\" width=\"1556\" height=\"874\" class=\"alignnone size-full wp-image-24630\" \/><\/p>\n<h2 id=\"what-are-the-reasons-behind-the-502-bad-gateway-error\"><span style=\"font-weight: 400;\">What are the reasons behind the 502 Bad Gateway error?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The 5xx status codes indicate that there are problems with the server, and 502 is not an exception. For some reason, the proxy server can\u2019t get a response or a valid response from the upstream server. This lack of response could be due to various problems:<\/span><\/p>\n<p><b>DNS issues<\/b><span style=\"font-weight: 400;\"> \u2013 Incorrect DNS settings can render a server unreachable, contributing to this error.<\/span><\/p>\n<p><b>Firewall blocks<\/b><span style=\"font-weight: 400;\"> \u2013 Firewalls that incorrectly identify and block communication between servers can cause a 502 error. This might happen if the firewall detects false threats and blocks certain internet providers or IP addresses.<\/span><\/p>\n<p><b>Browser problems<\/b><span style=\"font-weight: 400;\"> \u2013 Outdated browser versions or corrupted files in the browser cache can sometimes trigger 502 errors, though this is less common.<\/span><\/p>\n<p><b>Server Overload <\/b><span style=\"font-weight: 400;\">\u2013 This issue arises when the server hosting the website runs out of resources, potentially due to an unexpected spike in traffic or low memory, leading to crashes and resulting in a 502 error.<\/span><\/p>\n<p><b>Network errors and hosting issues<\/b><span style=\"font-weight: 400;\"> \u2013 Problems in the network, including issues with routers, modems, or other network devices, can lead to a 502 Bad Gateway error.<\/span><\/p>\n<p><b>Faulty plugins or themes<\/b><span style=\"font-weight: 400;\"> \u2013 Bugs in the website\u2019s code or problems with third-party services that the website depends on are common sources of this error.<\/span><\/p>\n<p><b>Server software timeouts<\/b><span style=\"font-weight: 400;\"> \u2013 A 502 error may occur if a server takes too long to respond, leading the other server to time out.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In your WordPress website with Nginx\/PHP-FPM stack, a 502 error can happen when PHP-FPM is not running, or Nginx can\u2019t communicate with PHP-FPM for some reason. Your hosting provider should check this case. Another reason could be PHP-FPM timeout issues, which we\u2019ll discuss down the line.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Any misunderstanding between Nginx and PHP-FPM can lead to a 502 Bad Gateway error.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Though these errors are often connected to server-side issues, there are some tips for troubleshooting on the client side.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s go over both client- and server-side troubleshooting.<\/span><\/p>\n\r\n<style>\r\n  #ctablocks_inline_90{\r\n          background-color: #000000;\r\n        color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_inline_90 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_inline_90 .button{\r\n        background-color: rgb(51,57,241);\r\n      color: #ffffff;\r\n    border-color: #3339f1 !important;\r\n  }\r\n  #ctablocks_inline_90 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n        #ctablocks_inline_90 .ctablocks_content_info p {\r\n        padding-left: 36px;\r\n      }\r\n      #ctablocks_inline_90 .ctablocks_content_button {\r\n          margin-left: 37px;\r\n      }\r\n  @media screen and (min-width: 768px) and (max-width: 1260px) {\r\n      #ctablocks_inline_90 .ctablocks_content_button {\r\n          margin-left: 37px !important;\r\n      }\r\n  }\r\n  ;\r\n<\/style>\r\n<div id=\"ctablocks_inline_90\" class=\"ctablocks_container inline_type\r\n        \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n      \r\n            <div class=\"title-wrap\">\r\n\t\t\t\t\t                  <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/info-icon-cta.png\" alt=\"Say goodbye to website errors\" title=\"Say goodbye to website errors\">\r\n\t\t\t\t\t            <h4>Say goodbye to website errors<\/h4>\r\n        <\/div>\r\n              <p>Achieve peace of mind with 99.99% uptime on 10Web Managed <br>WordPress Hosting, powered by Google Cloud. <\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/ai-website-builder\/\" class=\"button\" data-gtag=\"sign-up-blog\" data-buttontype=\"sign-up\" data-gtag=\"cta-90\" data-buttontype=\"cta-inline\"\r\n\t        >Learn How<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <\/div>\r\n\n<h2 id=\"how-to-troubleshoot-a-502-error-message\"><b>How to troubleshoot a 502 error message<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">It is important to note that a 502 error usually requires a fix by the web server or the proxies you are trying to access. In other words, the problem is probably not on your end, but there are steps you can take to try fixing these types of server errors.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are some straightforward ways of fixing 502 Bad Gateway errors from the client side.<\/span><\/p>\n<h3 id=\"reload-the-page\"><b>Reload the page<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">You should first reload the page <\/span><span style=\"font-weight: 400;\">(F5 or Ctrl + R) <\/span><span style=\"font-weight: 400;\">and wait for a minute. If the 502 Bad Gateway error disappears, it means there was a temporary problem with the upstream server or the networking between servers. If the error remains, check if the site is down for everyone.<\/span><\/p>\n<h3 id=\"check-if-the-website-is-down\"><b>Check if the website is down<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Ask friends or use services online to check if the website is down for everyone, which would confirm that the issue is on the website\u2019s end.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can use <\/span><a href=\"https:\/\/www.isitdownrightnow.com\/\"><span style=\"font-weight: 400;\">Is it down right now?<\/span><\/a><span style=\"font-weight: 400;\"> for this. <\/span><span style=\"font-weight: 400;\">If the website works for others but not for you, you can try other basic troubleshooting steps.<\/span><\/p>\n<h3 id=\"try-a-different-browser\"><b>Try a different browser<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sometimes, the issue might be related to the browser you\u2019re using. Switch to a different web browser and see if the problem persists. For example, switching from Google Chrome to Firefox or Microsoft Edge.<\/span><\/p>\n<h3 id=\"checking-in-an-incognito-window\"><b>Checking in an incognito window<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Open the site in an incognito or private browsing window to rule out browser extensions or cookie issues. To try this in Chrome:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Press <\/span><b>ctrl + shift + N<\/b><span style=\"font-weight: 400;\">, or<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the 3 vertical dots in Chrome\u2019s upper right corner and choose <\/span><b>New Incognito window.<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Try visiting the website with the 502 error.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">If the website loads in an incognito window, there may be an issue caused by cached data or a rogue extension.<\/span><\/p>\n<h3 id=\"check-using-a-different-device\"><b>Check using a different device<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Try accessing the site from another device to see if the issue is device-specific. Try visiting the website with the 502 error using your mobile device\u2019s connection. Turn off the mobile\u2019s Wi-Fi to ensure it\u2019s using the mobile data connection.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Suppose the site loads on a different device. In that case, you\u2019ll know you need to look closer at browser extensions or cached network data interfering with the website on the first device. If the site still doesn\u2019t load correctly, it strongly indicates that the issue isn\u2019t on your end, and you may have to wait until the website is back up and running. In the meantime, there are other troubleshooting steps you can try.<\/span><\/p>\n<h3 id=\"check-your-internet-connection\"><b>Check your internet connection<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Ensure your internet connection is stable and working with a fresh start. Try restarting your modem, router, computer, or the device you\u2019re having trouble with. This can help clear out any retained data that can cause 502 errors.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Shut down your computer.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Unplug the modem and router for about 30 seconds to ensure they power down fully.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Plug everything back in, and give it a few minutes for both devices to start back up. <\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Turn your computer back on.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Once you\u2019re back online, try rechecking the website.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">If none of the above steps fix the error, you\u2019ll have ruled out many possible problems with your local network. However, there are a couple more places where caching can cause problems.<\/span><\/p>\n<h3 id=\"clear-browser-cache-and-cookies\"><b>Clear browser cache and cookies<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Problems with cached browser data or cookies can cause 502 errors. Clearing your browser\u2019s cache and cookies might resolve the issue if the page loads in an incognito or private browsing window.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s how to clear Chrome\u2019s cache:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter <\/span><b>chrome:\/\/settings\/clearBrowserData<\/b><span style=\"font-weight: 400;\"> in the address bar or<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the 3 vertical dots in Chrome\u2019s upper right corner and choose <\/span><b>History<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on <\/span><b>Clear browsing data<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/chrome-clear-cache.jpg\" alt=\"Clearing Chrome's browsing data.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24769\" \/> <\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Tick all the boxes to ensure the cache is totally cleared<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select the Time Range from the drop-down menu<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Clear data<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache.jpg\" alt=\"Chrome clear browser cache window selected for all time.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-25016\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache.jpg 1560w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Clear-browser-cache-600x337.jpg 600w\" sizes=\"auto, (max-width: 1560px) 100vw, 1560px\" \/> <\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">This will clear all the browser\u2019s stored data it uses to speed up performance. Try visiting the website with the 502 error again to see if clearing the cache resolved the problem.<\/span><\/p>\n<h3 id=\"flush-dns-cache\"><b>Flush DNS cache<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">The 502 Bad Gateway error can occur because of DNS issues. Operating systems, such as Linux, Windows, and macOS, save name resolution information in the form of a DNS cache. Clearing the DNS cache can often solve a 502 Bad Gateway error. <\/span><span style=\"font-weight: 400;\">In particular, if your site is experiencing the error and you\u2019ve just switched hosting or changed the domain\u2019s DNS records, flushing your computer\u2019s DNS cache and allowing ample time for DNS propagation can help fix the error.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are the commands which you can use for flushing the DNS cache on Windows, macOS, and Linux. <\/span><\/p>\n<h4><b><img loading=\"lazy\" decoding=\"async\" class='device-icon' src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/win.png\" alt=\"Windows\" width=\"32\" height=\"32\" \/> <\/b><b>Use these commands to flush the cache on Windows:<\/b><\/h4>\n<p style=\"position: relative; padding-bottom: calc(56.25651720542232% + 41px); height: 0;\"><iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; color-scheme: light;\" src=\"https:\/\/demo.arcade.software\/e6Qk3QcJlEqCIG2zleIQ?embed\" title=\"Release and renew the IP address and flush DNS cacheWindows\" frameborder=\"0\" loading=\"lazy\" webkitallowfullscreen=\"webkitallowfullscreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<pre>ipconfig \/flushdns<\/pre>\n<p><span style=\"font-weight: 400;\">You can do this by opening a Command Prompt.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Press the <\/span><b>Windows <\/b><span style=\"font-weight: 400;\">key<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type <\/span><b>cmd <\/b><span style=\"font-weight: 400;\">and press <\/span><b>Enter<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type <\/span><b>ipconfig \/flushdns<\/b><span style=\"font-weight: 400;\"> in the command prompt and press <\/span><b>Enter<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">You\u2019ll then see a message stating <\/span><i><span style=\"font-weight: 400;\">Successfully flushed the DNS Resover Cache.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2.jpg\" alt=\"Flushing dns in command prompt.\" width=\"1560\" height=\"878\" class=\"alignnone size-full wp-image-24854\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2.jpg 1560w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-742x418.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-1484x835.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-768x432.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-1536x864.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Flush-DNS-windows-2-600x338.jpg 600w\" sizes=\"auto, (max-width: 1560px) 100vw, 1560px\" \/><br \/>\n<\/span><\/i><\/p>\n<p><b><img loading=\"lazy\" decoding=\"async\" class='device-icon' src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/mac.png\" alt=\"mac\" width=\"32\" height=\"32\" \/> On macOS, you should open the terminal and type:<\/b><\/p>\n<pre>sudo killall -HUP mDNSResponder<\/pre>\n<p><span style=\"font-weight: 400;\">There\u2019s no message after processing this command, but you can add your own by running the command like this:<\/span><\/p>\n<pre>sudo killall -HUP mDNSResponder &amp;amp;&amp;amp; echo macOS DNS Cache Reset<\/pre>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on <\/span><b>Go <\/b><span style=\"font-weight: 400;\">in the toolbar<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select <\/span><b>Utilities<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open <\/span><b>Terminal<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type <\/span><b>sudo killall -HUP mDNSResponder &amp;&amp; echo macOS DNS Cache Reset<\/b><span style=\"font-weight: 400;\"> and hit <\/span><b>Enter<\/b><span style=\"font-weight: 400;\">. <\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter your admin password when prompted.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1.jpg\" alt=\"Terminal on a Mac showing the command for flushing DNS.\" width=\"1484\" height=\"835\" class=\"alignnone size-full wp-image-24617\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1-742x418.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1-768x432.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/Flush-DNS-Mac-1484x835-1-600x338.jpg 600w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><br \/>\n<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Things are different in Linux, as Linux distributions use various DNS services. Some are NSCD (Name Service Caching Daemon), dnsmasq, and BIND (Berkeley Internet Name Domain). For an NSCD DNS cache:<\/span><\/p>\n<pre>sudo \/etc\/init.d\/nscd restart<\/pre>\n<p><span style=\"font-weight: 400;\">For a dnsmasq DNS cache:<\/span><\/p>\n<pre>sudo \/etc\/init.d\/dnsmasq restart<\/pre>\n<p><span style=\"font-weight: 400;\">For a BIND DNS cache:<\/span><\/p>\n<pre>sudo \/etc\/init.d\/named restart<\/pre>\n<pre>sudo rndc restart<\/pre>\n<pre>sudo rndc exec<\/pre>\n<p><span style=\"font-weight: 400;\">If the terminal asks for your password, just enter it.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">After you\u2019ve flushed your computer\u2019s DNS cache, visit the website experiencing the issue again.<\/span><\/p>\n<h3 id=\"change-dns-servers\"><b>Change DNS servers<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Try changing your DNS servers to check if you\u2019re having trouble with your DNS. You can switch to a public DNS service like Google DNS or OpenDNS.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Google Public DNS: 8.8.8.8 or 8.8.4.4<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Cloudflare DNS: 1.1.1.1 or 1.0.0.1<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">OpenDNS Home: 208.67.222.222 or 208.67.220.220<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">AdGuard DNS: 94.140.14.14 or 94.140.15.15<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Quad9: 9.9.9.9 or 149.112.112.112<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You can find more information about changing DNS servers in this article: <\/span><a href=\"https:\/\/developers.google.com\/speed\/public-dns\/docs\/using\"><span style=\"font-weight: 400;\">Change your DNS servers settings<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Before making changes to your DNS, remember to note your current DNS settings and IP addresses in case you want to revert back to your original setup after troubleshooting. A few screenshots taken before changes may prove helpful for reference.<\/span><\/p>\n<h4><b><img loading=\"lazy\" decoding=\"async\" class='device-icon' src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/win.png\" alt=\"Windows\" width=\"32\" height=\"32\" \/> <\/b><b>Windows<\/b><\/h4>\n<p style=\"position: relative; padding-bottom: calc(56.25651720542232% + 41px); height: 0;\"><iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; color-scheme: light;\" src=\"https:\/\/demo.arcade.software\/5O4UpKTM1UysEv6Hhxyb?embed\" title=\"Changing DNS Servers Windows\" frameborder=\"0\" loading=\"lazy\" webkitallowfullscreen=\"webkitallowfullscreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on <\/span><b>Start &gt; Settings &gt; Network &amp; Internet<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select your internet connection (for example, your current Wi-Fi network)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Hardware properties<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Edit <\/b><span style=\"font-weight: 400;\">next to <\/span><b>DNS server assignment<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Switch from <\/span><b>Automatic <\/b><span style=\"font-weight: 400;\">to <\/span><b>Manual<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select <\/span><b>IPv4<\/b><span style=\"font-weight: 400;\"> or <\/span><b>IPv6<\/b><span style=\"font-weight: 400;\"> (whichever your ISP requires)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter the new DNS server IP addresses in the<\/span><b> Preferred DNS<\/b><span style=\"font-weight: 400;\"> field.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enable <\/span><b>encryption<\/b><span style=\"font-weight: 400;\">, if available.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Save<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ol>\n<h4><b><img loading=\"lazy\" decoding=\"async\" class='device-icon' src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/mac.png\" alt=\"mac\" width=\"32\" height=\"32\" \/> Mac<\/b><\/h4>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click the<\/span><b> Apple logo &gt; System Settings &gt; Network<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select your internet connection (for example, your current Wi-Fi network)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Details<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open the <\/span><b>DNS<\/b><span style=\"font-weight: 400;\"> tab in the pop-up window<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Change the <\/span><b>IPv4<\/b><span style=\"font-weight: 400;\"> or <\/span><b>IPv6 <\/b><span style=\"font-weight: 400;\">addresses, or<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>+<\/b><span style=\"font-weight: 400;\"> to add new DNS server addresses<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>OK<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac.jpg\" alt=\"Settings in the Mac system where DNS servers can be changed\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24915\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac.jpg 1560w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Change-DNS-server-in-Mac-600x337.jpg 600w\" sizes=\"auto, (max-width: 1560px) 100vw, 1560px\" \/><br \/>\n<\/b><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Check to see if changing the DNS servers resolved the problem. If not, switch back to your original DNS settings. If you already use custom DNS, consider switching to your ISP\u2019s default DNS servers to see if that fixes the problem.<\/span><\/p>\n<h3 id=\"disable-vpn-or-proxy\"><b>Disable VPN or proxy<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Many people use a VPN or web proxy to protect their private information. These services can interfere with some websites and cause 502 errors, even if configured and working correctly. If you\u2019re using a VPN or proxy, try disabling it. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Most VPN services make turning your VPN connection on or off easy. For example, to disconnect from your VPN using OpenVPN in Windows:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the <\/span><b>system tray<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click the <\/span><b>OpenVPN<\/b><span style=\"font-weight: 400;\"> icon<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Toggle<\/b><span style=\"font-weight: 400;\"> the connection off to disconnect<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">When turning off your VPN, remember to switch it back on after browsing or troubleshooting.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/disable-vpn.jpg\" alt=\"Turning off VPN connection in OpenVPN.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24774\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Alternatively, take a look at your proxy settings to check for issues.<\/span><\/p>\n<h4><b><img loading=\"lazy\" decoding=\"async\" class='device-icon' src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/win.png\" alt=\"Windows\" width=\"32\" height=\"32\" \/> Windows<\/b><\/h4>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click the <\/span><b>Windows <\/b><span style=\"font-weight: 400;\">shortcut key<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type <\/span><b>Control Panel<\/b><span style=\"font-weight: 400;\"> and press <\/span><b>Enter<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Internet Options<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Connections &gt; LAN Settings<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Uncheck the boxes for <\/span><b>Automatically detect settings<\/b><span style=\"font-weight: 400;\"> and <\/span><b>Use proxy server for LAN<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>OK<\/b><\/li>\n<\/ol>\n<h4><b><img loading=\"lazy\" decoding=\"async\" class='device-icon' src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/mac.png\" alt=\"mac\" width=\"32\" height=\"32\" \/> Mac<\/b><\/h4>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the <\/span><b>Apple<\/b><span style=\"font-weight: 400;\"> icon on the top left and choose <\/span><b>System Settings<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on <\/span><b>Network<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the network you\u2019re using (usually Wi-Fi or Ethernet)<\/span><\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Proxy-off-1-mac.jpg\" alt=\"Turning proxy off on a Mac.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24780\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Details<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click the <\/span><b>Proxies <\/b><span style=\"font-weight: 400;\">tab<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Turn off all toggles<\/b><span style=\"font-weight: 400;\"> for the different proxy protocols listed<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Proxy-off-mac.jpg\" alt=\"Toggles to turn off proxy on Mac.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24781\" \/> <\/span><\/li>\n<\/ol>\n<h3 id=\"check-for-updates\"><b>Check for updates<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Ensure your browser and any related plugins or extensions are up to date. Outdated software can lead to various issues, including 502 errors. For example, you can try taking a look at Chrome\u2019s extensions:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enter <\/span><b>chrome:\/\/extensions\/<\/b><span style=\"font-weight: 400;\"> in the address bar or<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click on the <\/span><b>3 dot menu<\/b><span style=\"font-weight: 400;\"> in Chrome\u2019s upper right corner.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select <\/span><b><b>Extensions &gt; Manage Extensions.<\/b><\/b><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/manage-extensions.jpg\" alt=\"Chrome menu - Extensions - Manage Extensions to turn extensions off.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24779\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Scan the installed extensions and consider <\/span><b>uninstalling <\/b><span style=\"font-weight: 400;\">any that are unneeded.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Scan the remaining extensions for any that haven\u2019t had a <\/span><b>recent update<\/b><span style=\"font-weight: 400;\">. If they haven\u2019t been updated in the last 3 months, it may be time to get rid of them.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use the <\/span><b>toggles<\/b><span style=\"font-weight: 400;\"> to turn off each extension, and try loading the website with the error.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If the website works, you know there\u2019s an issue with an extension.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Try turning them on one by one, testing the 502 website error each time until you find the problematic extension.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Remember, if none of these methods work, the problem is likely on the server side, and only the website\u2019s admin or owner can fix it. In that case, you\u2019ll have to wait and try accessing the site later.<\/span><\/p>\n<h2 id=\"impact-of-502-errors-on-seo\"><span style=\"font-weight: 400;\">Impact of 502 errors on SEO<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">A <\/span><i><span style=\"font-weight: 400;\">502 Bad Gateway<\/span><\/i><span style=\"font-weight: 400;\"> error can negatively affect your website\u2019s search engine optimization (SEO). If the site\u2019s down, neither visitors nor search engine crawlers can access it. <\/span><\/p>\n<h3 id=\"short-term-vs-long-term-downtime\"><b>Short-term vs. long-term downtime<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Suppose your site experiences a 502 error but is down briefly, like 10 minutes. In that case, the impact on SEO might be minimal. This is because search engines might retrieve the page from the cache during this downtime if your site is crawled frequently.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If the site recovers before Google\u2019s re-crawl, it\u2019s unlikely to be negatively impacted. However, the implications are more severe if the site remains down for an extended period, say over 6 hours.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Extended downtime could lead Google to perceive the 502 error as a significant issue, potentially harming your site\u2019s rankings. If 502 errors occur repeatedly or persist for extended periods, it\u2019s crucial to investigate and resolve the underlying causes to avoid long-term SEO damage.<\/span><\/p>\n<h3 id=\"mitigating-seo-impact\"><b>Mitigating SEO impact<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">To mitigate the SEO impact of 502 errors and prevent their recurrence on your own websites, consider the following solutions:<\/span><\/p>\n<p><b>Diagnose the cause<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Identifying the root cause of the 502 errors should be a priority. Common culprits include server overload, network issues, or faulty server configurations. Third-party plugins and themes are often to blame for 502 errors on WordPress sites.<\/span><\/p>\n<p><b>Improve server reliability<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Upgrade your hosting solution or optimize server resources to handle traffic spikes effectively.<\/span><\/p>\n<p><b>Optimize web application<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Regularly update and maintain your web application to prevent bugs that might lead to 502 errors.<\/span><\/p>\n<p><b>Use a CDN<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Implement a Content Delivery Network (CDN) to distribute traffic load and provide an additional layer of reliability.<\/span><\/p>\n<p><b>Monitor website uptime<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Use website monitoring tools to get alerts when your site goes down, allowing for quicker response and resolution.<\/span><\/p>\n<p><b>Implement good error handling<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Customize your 502 error page to inform users and search engines that the issue is temporary and provide alternative navigation options.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s how you can get your website back up and running when you see 502 bad gateway errors on your own site.<\/span><\/p>\n<h2 id=\"correcting-502-errors-on-your-website\"><span style=\"font-weight: 400;\">Correcting 502 errors on your website<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Several common pitfalls can cause a WordPress website to show 502 bad gateway errors. If the task of getting your website back up and running falls to you, here are some recommendations for tracking down problems that lead to these types of errors.<\/span><\/p>\n<h3 id=\"check-server-health\"><b>Check server health<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Ensure your server is not overloaded or experiencing downtime. Contact your hosting provider for assistance or check the host\u2019s status page.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Depending on your web host\u2019s policies and configuration, the server may automatically stop any processes or requests that take too long. This can lead to timeout errors. Additional or similar procedures may be in place to prevent the whole site from going down or bogging down the shared server for other websites. These types of configurations can lead to 502 errors.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Higher-quality web hosting typically uses containerized architecture to eliminate these types of issues with shared hosting. This way, even if one site experiences a problem or downtime, it doesn\u2019t affect your other sites.<\/span><\/p>\n<h3 id=\"review-recent-changes\"><b>Review recent changes<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">If the error started after a recent change (like software updates or configuration changes), revert those changes to see if it resolves the issue.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You may have recently changed your domain\u2019s DNS records or migrated your website to new hosting. In that case, you may need to wait until the new records propagate throughout the DNS system. Time for this process varies, but give it at least 24 hours to complete.<\/span><\/p>\n<h3 id=\"restart-php\"><span style=\"font-weight: 400;\">Restart PHP<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">WordPress sites run on PHP. If your server\u2019s PHP engine isn\u2019t working correctly, the site won\u2019t be able to function properly. Depending on your web host, you may be able to restart the PHP engine from your hosting control panel or dashboard.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/restart-php.jpg\" alt=\"Restarting PHP engine in web hosting panel.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24629\" \/><\/p>\n<p><span style=\"font-weight: 400;\">With 10Web, you can do this by going to <\/span><b>Hosting Services &gt; Tools<\/b><span style=\"font-weight: 400;\"> and clicking the blue <\/span><b>\u201cRestart PHP\u201d<\/b><span style=\"font-weight: 400;\"> button. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">If your hosting doesn\u2019t provide an interface for restarting PHP, ask them to do it for you.<\/span><\/p>\n<h3 id=\"restart-php-fpm-service\"><b>Restart PHP-FPM service<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">You will get a 502 error if the PHP-FPM service is inactive or not running on your server. If you have access to your hosting, you can check this by running one of the following commands. For SysVinit:<\/span><\/p>\n<pre>sudo service php7.4-fpm status<\/pre>\n<p><span style=\"font-weight: 400;\">For SystemD:<\/span><\/p>\n<pre>sudo systemctl status php7.4-fpm<\/pre>\n<p><span style=\"font-weight: 400;\">If the service is active and running, the output of the command should be like this:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/8.jpg\" alt=\"fixing 502 bad gateway error server-side\" width=\"1484\" height=\"832\" class=\"alignnone size-full wp-image-17060\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/8.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/8-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/8-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/8-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2021\/05\/8-371x208.jpg 371w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">If the status is not Active: active(running), try restarting PHP-FPM service to resolve the error using one of the following commands. For SysVinit:<\/span><\/p>\n<pre>sudo service php7.4-fpm restart<\/pre>\n<p><span style=\"font-weight: 400;\">For SystemD:<\/span><\/p>\n<pre>sudo systemctl restart php7.4-fpm<\/pre>\n<h3 id=\"timeout-issues\"><b>Timeout issues<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">A PHP-FPM timeout can cause the 502 error. If your application takes too long to respond, users will experience a timeout error. If the PHP-FPM timeout is less than Nginx timeout, Nginx will return a 502 Bad Gateway error. To avoid this, you can increase PHP-FPM timeout if you can access your server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">PHP-FPM timeout is set in pool configuration, which is<\/span><\/p>\n<pre>request_terminate_timeout<\/pre>\n<p><span style=\"font-weight: 400;\">The default value for this directive is 20 seconds. If you can\u2019t access your server, ask your hosting provider to check it. To avoid getting 504 errors after increasing PHP-FPM timeout which can be because of Nginx timeout, the default is 60 seconds, you can increase fastcgi_read_timeout directive in \/etc\/nginx\/nginx.conf file. Don\u2019t forget to reload the Nginx server after changing the directive:<\/span><\/p>\n<pre>nginx -s reload<\/pre>\n<p><span style=\"font-weight: 400;\">PHP execution time errors can also lead to 502 Bad Gateway errors. To avoid this, you can increase the PHP configs, such as max_exexution_time and max_input_time.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you have server access, just change these directives in your php.ini file. If not, ask your hosting provider to do it for you.<\/span><\/p>\n<h3 id=\"update-wordpress-plugins-and-themes\"><b>Update WordPress, plugins, and themes<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Outdated WordPress core, plugins, or themes can cause compatibility issues, leading to 502 errors. Regularly update them to the latest versions in the WordPress admin.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It\u2019s always a good idea to back up your website before installing any updates. If something\u2019s broken after updating, you can restore the backup and work on figuring out what went wrong.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here\u2019s how to check for available updates and install them in bulk.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in to your WordPress admin. (e.g., yourdomain.com\/wp-admin)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Hover over <\/span><b>Dashboard <\/b><span style=\"font-weight: 400;\">in the left navigation and click <\/span><b>Updates <\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">in the pop-up<\/span><\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/dashboard-updates.jpg\" alt=\"Updates page in WordPress admin navigation under Dashboard.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24615\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Scan the page for available updates<\/span><\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/updates-page.jpg\" alt=\"Updates page in the WordPress admin.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24631\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use the tick boxes to select plugins and themes with updates<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select <\/span><b>Update <\/b><span style=\"font-weight: 400;\">in the drop-down menu<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Apply<\/b><\/li>\n<\/ol>\n<h3 id=\"consult-server-logs\"><b>Consult server logs<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Server logs can provide detailed insights into the root cause of the issue.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs.jpg\" alt=\"Logs in the 10Web dashboard.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24999\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs.jpg 1560w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-742x416.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-1484x832.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-768x431.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-1536x862.jpg 1536w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Error-logs-600x337.jpg 600w\" sizes=\"auto, (max-width: 1560px) 100vw, 1560px\" \/><\/p>\n<p><span style=\"font-weight: 400;\"> Particularly in the case of a conflicting plugin or theme, the error log can direct you to a file path associated with the error.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">With 10Web, you can easily check server logs by going to <\/span><b>Hosting Services &gt; Logs.<\/b> <span style=\"font-weight: 400;\"> You can check server logs directly if you have access to your file system. In the case of the Nginx web server, you can find logs here:<\/span><\/p>\n<pre>\/var\/log\/nginx<\/pre>\n<p><span style=\"font-weight: 400;\">In the case of Apache web server, the logs are in this repository:<\/span><\/p>\n<pre>\/var\/log\/apache2<\/pre>\n<p><span style=\"font-weight: 400;\">Scan the logs for errors containing file paths like <\/span><i><span style=\"font-weight: 400;\">wp-content\/plugins<\/span><\/i><span style=\"font-weight: 400;\"> or <\/span><i><span style=\"font-weight: 400;\">wp-content\/themes<\/span><\/i><span style=\"font-weight: 400;\">. If you find one, you\u2019ll know which plugin or theme to deactivate for troubleshooting. You may also find PHP timeout errors, which can cause 502 bad gateway errors.<\/span><\/p>\n<h3 id=\"check-plugins-and-themes-for-conflicts\"><b>Check plugins and themes for conflicts<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sometimes, non-optimal codes in WordPress plugins and themes can cause 502 errors. If you can\u2019t find the culprit in the server logs, try to deactivate all plugins and revert to a default theme (like Twenty Twenty-One). If the error resolves, reactivate each one by one to identify the source of the error.<\/span><\/p>\n<h4><b>Testing plugins when you can access the WordPress admin<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">If you can access <\/span><i><span style=\"font-weight: 400;\">yoursite.com\/wp-admin<\/span><\/i><span style=\"font-weight: 400;\">, you can try deactivating the plugin or theme found in the error log. If your error log search didn\u2019t turn up anything useful, you can deactivate all the plugins in bulk from the Plugins page.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Log in to your WordPress admin account<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to <\/span><b><b>Plugins<\/b><\/b><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/deactivate-plugins.jpg\" alt=\"Deactivating plugins in the WordPress admin.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24772\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Tick <\/b><span style=\"font-weight: 400;\">the box to select all plugins<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select <\/span><b>Deactivate <\/b><span style=\"font-weight: 400;\">from the <\/span><b>Bulk Actions<\/b><span style=\"font-weight: 400;\"> drop-down menu<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Apply<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Test the site, and if it works, start reactivating the plugins one by one, checking the site each time for the 502 error until it reappears. After you activate the problem plugin and see the error again, you\u2019ll know which one is causing the error. You can then contact the plugin\u2019s developer for help or ask for assistance in the plugin or theme\u2019s WordPress support forum.<\/span><\/p>\n<h4><b>Testing plugins when you cannot access the WordPress admin<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">If you can\u2019t access the WordPress admin, you\u2019ll need to use FTP to access your website\u2019s files on the server. You can use an FTP client like <\/span><a href=\"https:\/\/filezilla-project.org\/\"><span style=\"font-weight: 400;\">FileZilla<\/span><\/a><span style=\"font-weight: 400;\"> to do that.<\/span><\/p>\n<p style=\"position: relative; padding-bottom: calc(56.22294372294372% + 41px); height: 0;\"><iframe style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; color-scheme: light;\" src=\"https:\/\/demo.arcade.software\/VPzZVFPJ7sDyC9VAtSOD?embed\" title=\"Arcade Flow (Fri Jan 12 2024)\" frameborder=\"0\" loading=\"lazy\" webkitallowfullscreen=\"webkitallowfullscreen\" mozallowfullscreen=\"mozallowfullscreen\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Find your FTP credentials from your web host<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use an FTP client like FileZilla to access your website files.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Rename your<\/span><b> wp-content\/plugins<\/b><span style=\"font-weight: 400;\"> folder to disable all plugins, or if you found a particular plugin or theme in the error log, you can <\/span><b>rename that specific folder<\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"> instead of renaming the plugins folder.<\/span><\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/Rename-plugins-folder.jpg\" alt=\"Renaming the WordPress plugins folder via FTP for troubleshooting.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24782\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Test <\/b><span style=\"font-weight: 400;\">the site with the 502 error.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If the site works, <\/span><b>reactivate <\/b><span style=\"font-weight: 400;\">the plugins by changing the folder\u2019s name back to plugins.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Repeat <\/b><span style=\"font-weight: 400;\">the process of deactivating plugins or themes by renaming the respective folder and testing the site for the error until you find the problematic plugin.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Once you\u2019ve found the plugin or theme causing the error, you can contact the developer or ask for help in the plugin\u2019s or theme\u2019s WordPress forum.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">And don\u2019t forget to keep your plugins, theme, and WordPress core up-to-date. This will help you avoid many problems, including 502 errors.<\/span><\/p>\n<h3 id=\"increase-php-memory-limit\"><b>Increase PHP memory limit<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Sometimes, insufficient PHP memory can cause 502 errors. Increase the PHP memory limit in the wp-config.php file by adding this line:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">define(&#8216;WP_MEMORY_LIMIT&#8217;, &#8216;256M&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can edit the wp-config.php file via FTP or your web hosting\u2019s file manager. For example, with FileZilla:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Find your FTP credentials from your web host<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use an FTP client like FileZilla to access your website files.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Navigate to your WordPress files and scan the list for <\/span><b>wp-config.php<\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">.<\/span><\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/wp-config-ftp.jpg\" alt=\"wp-config.php shown in an FTP client.\" width=\"1560\" height=\"875\" class=\"alignnone size-full wp-image-24632\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Right-click the <\/span><b>wp-config.php<\/b><span style=\"font-weight: 400;\"> file and select <\/span><b>Download<\/b><span style=\"font-weight: 400;\"> to save a copy<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Right-click the <\/span><b>wp-config.php<\/b><span style=\"font-weight: 400;\"> file again and select <\/span><b>View\/Edit<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Search the file\u2019s code for a line like <\/span><b>define(\u2018WP_MEMORY_LIMIT\u2019, \u2018128M\u2019);<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you don\u2019t find the line, add it to the end of the file above where it says \/* That\u2019s all, stop editing! Happy publishing. *\/<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Make sure the number at the line\u2019s end is <\/span><b>256M<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Save the file<\/span><\/li>\n<\/ol>\n<h3 id=\"check-htaccess-file\"><b>Check .htaccess file<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Incorrect rules in the .htaccess file can lead to 502 errors. Try restoring it to default to see if it resolves the issue. Like the wp-config.php file, you can access the .htaccess file via FTP or your web host\u2019s file manager. Here\u2019s an example of backing up the .htaccess file and renaming it for troubleshooting.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Find your FTP credentials from your web host<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use an FTP client like FileZilla to access your website files.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Search for .<\/span><b>htaccess<\/b><span style=\"font-weight: 400;\"> in the file names. The exact location varies between web hosts. It\u2019s commonly found near the top level of website files. Because the .htaccess filename begins with a period, you may need to enable the option to <\/span><b>view hidden files<\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"> to see it.<\/span><\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file.jpg\" alt=\".htaccess file shown in FTP client.\" width=\"1484\" height=\"835\" class=\"alignnone size-full wp-image-24620\" srcset=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file.jpg 1484w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file-742x418.jpg 742w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file-150x84.jpg 150w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file-768x432.jpg 768w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file-371x208.jpg 371w, https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/htaccess-file-600x338.jpg 600w\" sizes=\"auto, (max-width: 1484px) 100vw, 1484px\" \/><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Right-click on the file and select <\/span><b>Download<\/b><span style=\"font-weight: 400;\">. This is your backup copy.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Right-click the file again and select <\/span><b>Rename.<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Rename the file however you prefer. You might add the date for later reference.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Test the website with the .htaccess file disabled. If it works, you\u2019ll know there\u2019s an issue with the .htaccess file.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">While there are exceptions, many times if you delete or rename the .htaccess file, your web host automatically adds a new .htaccess file. The new file may contain only some of the original rules or be completely empty by default. You must examine your site\u2019s .htaccess file for typos or misconfigurations. Try adding back any existing rules one by one to see which is causing the error.<\/span><\/p>\n<h3 id=\"review-cdn-settings\"><b>Review CDN settings<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">If you use a Content Delivery Network (CDN), ensure it\u2019s configured correctly. Errors in CDN settings can result in 502 errors. Depending on your CDN setup, try disabling the CDN temporarily to see if that fixes the issue. <\/span><\/p>\n<h3 id=\"502-bad-gateway-errors-with-cloudflare\"><b>502 bad gateway errors with Cloudflare<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">If your site uses Cloudflare and you see a message like <\/span><i><span style=\"font-weight: 400;\">502 Bad Gateway Cloudflare, <\/span><\/i><span style=\"font-weight: 400;\">you can rest easy knowing it\u2019s probably a Cloudflare issue. <\/span><a href=\"https:\/\/www.cloudflarestatus.com\/\"><span style=\"font-weight: 400;\">Check the status page<\/span><\/a><span style=\"font-weight: 400;\"> for any existing outages or contact support for assistance.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/cloudflare-502-error.jpg\" alt=\"Cloudflare's basic 502 bad gateway page.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24613\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In a second version, Cloudflare sites may display <\/span><i><span style=\"font-weight: 400;\">Error 502 bad gateway<\/span><\/i><span style=\"font-weight: 400;\">, and a graphic depicting an issue between Cloudflare and the site\u2019s web host. In this case, it\u2019s most likely an issue with your web host.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/cloudflare-502-error-graphic.jpg\" alt=\"Cloudflare's error 502 page showing a problem between cloudflare service and the web host.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24614\" \/><\/p>\n<p><span style=\"font-weight: 400;\">You can read more about Cloudflare 5xx errors in the article <\/span><a href=\"https:\/\/support.cloudflare.com\/hc\/en-us\/articles\/115003011431-Troubleshooting-Cloudflare-5XX-errors\"><span style=\"font-weight: 400;\">Troubleshooting Cloudflare 5XX errors<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3 id=\"check-for-server-side-firewalls\"><b>Check for server-side firewalls<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Improper firewall configuration can lead to 502 Bad Gateway errors. A firewall is a network security system that monitors and controls the incoming and outgoing network traffic based on predetermined security rules. It typically establishes a barrier between a trusted network and an untrusted network.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There can be cases in which some awkward firewall settings can consider safe and valid content malicious and, consequently, cut off traffic, which in turn causes 502 Bad Gateway errors. Check with your web hosting to ensure server-side firewalls are not mistakenly blocking legitimate requests. In this case, you may see an error message stating <\/span><i><span style=\"font-weight: 400;\">Hosting Server Read Timeout HTTP 502 \u2013 unable to connect to the origin server<\/span><\/i><span style=\"font-weight: 400;\"> and depicting an issue between Cloudflare and your web host.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/http-502-timeout.jpg\" alt=\"HTTP 502 timeout error between GoDaddy firewall and hosting.\" width=\"1560\" height=\"877\" class=\"alignnone size-full wp-image-24621\" \/><\/p>\n<h3 id=\"contact-hosting-provider\"><b>Contact hosting provider<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Contact your hosting provider for assistance if you cannot resolve the issue.<\/span><\/p>\n<h2 id=\"navigating-through-the-502-bad-gateway-fog\"><span style=\"font-weight: 400;\">Navigating through the 502 bad gateway fog<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Despite their seemingly daunting nature, understanding 502 errors is the first step towards fixing them. Remember, while there are a few tricks you can try on your end\u2014like refreshing the page, checking your internet connection, or switching browsers\u2014the real fix usually lies with the website\u2019s server or network. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">So, the next time you encounter this error, take a breath, and try the basics, but be patient. You may have to wait until the website is accessible. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, we\u2019re curious to hear from you! What\u2019s your go-to move when you bump into a 502 Bad Gateway error? Do you have any personal tips or tricks up your sleeve? Let us know your experiences and strategies in the comments below.<\/span><br \/>\n\r\n<style>\r\n  #ctablocks_inline_90{\r\n          background-color: #000000;\r\n        color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_inline_90 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_inline_90 .button{\r\n        background-color: rgb(51,57,241);\r\n      color: #ffffff;\r\n    border-color: #3339f1 !important;\r\n  }\r\n  #ctablocks_inline_90 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n        #ctablocks_inline_90 .ctablocks_content_info p {\r\n        padding-left: 36px;\r\n      }\r\n      #ctablocks_inline_90 .ctablocks_content_button {\r\n          margin-left: 37px;\r\n      }\r\n  @media screen and (min-width: 768px) and (max-width: 1260px) {\r\n      #ctablocks_inline_90 .ctablocks_content_button {\r\n          margin-left: 37px !important;\r\n      }\r\n  }\r\n  ;\r\n<\/style>\r\n<div id=\"ctablocks_inline_90\" class=\"ctablocks_container inline_type\r\n        \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n      \r\n            <div class=\"title-wrap\">\r\n\t\t\t\t\t                  <img decoding=\"async\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/info-icon-cta.png\" alt=\"Say goodbye to website errors\" title=\"Say goodbye to website errors\">\r\n\t\t\t\t\t            <h4>Say goodbye to website errors<\/h4>\r\n        <\/div>\r\n              <p>Achieve peace of mind with 99.99% uptime on 10Web Managed <br>WordPress Hosting, powered by Google Cloud. <\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/ai-website-builder\/\" class=\"button\" data-gtag=\"sign-up-blog\" data-buttontype=\"sign-up\" data-gtag=\"cta-90\" data-buttontype=\"cta-inline\"\r\n\t        >Learn How<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <\/div>\r\n \r\n<style>\r\n  #ctablocks_scrollbox-with-icon_89{\r\n            color: #ffffff;\r\n    border-radius: 6px;\r\n  }\r\n\r\n  #ctablocks_scrollbox-with-icon_89 p{\r\n    color: #ffffff;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_89 .button{\r\n          background-color: rgb(51,57,241);\r\n        color: #ffffff;\r\n    border-color: #3339f1 !important;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_89 .button:hover{\r\n    background: rgba(51,57,241,0.8);\r\n    color: #ffffff;\r\n    opacity: 1;\r\n  }\r\n  #ctablocks_scrollbox-with-icon_89.ctablocks_container {\r\n    left: 100%;\r\n  }\r\n  @media screen and (max-width: 1300px) {\r\n      #ctablocks_scrollbox-with-icon_89.ctablocks_container {\r\n          left: 0;\r\n          margin: 0 auto;\r\n      }\r\n  }\r\n  #ctablocks_scrollbox-with-icon_89 .ctablocks_content {\r\n      background-color: #000000;\r\n  }\r\n<\/style>\r\n<div id=\"ctablocks_scrollbox-with-icon_89\" class=\"ctablocks_container scrollbox-with-icon_type\r\n      \">\r\n\r\n  <div class=\"ctablocks_content clear\">\r\n    <div class=\"ctablocks_content_info\">\r\n              <h4>Say goodbye to website errors<\/h4>\r\n        <h4 class=\"mobile-title\">Fix all the website errors in one click<\/h4>\r\n              <p>Migrate your website to the world's best Managed WordPress Hosting.<\/p>\r\n          <\/div>\r\n    <div class=\"ctablocks_content_button\">\r\n              <a href=\"https:\/\/10web.io\/ai-website-builder\/\" class=\"button\" data-gtag=\"sign-up-blog\" data-buttontype=\"sign-up\" data-gtag=\"cta-89\" data-buttontype=\"cta-scrollbox-with-icon\"\r\n\t        >Migrate For Free<\/a>\r\n            \r\n    <\/div>\r\n  <\/div>\r\n    <span class=\"close_ctablocks\">\r\n      <img decoding=\"async\" class=\"close-icon\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/close_w.svg\" class=\"close\">\r\n      <img decoding=\"async\" class=\"floating-icon\" src=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2024\/04\/Info-icon_Blog.png\" alt=\"Say goodbye to website errors\" title=\"Say goodbye to website errors\">\r\n<!--      <img decoding=\"async\" class=\"arrow-icon white\" src=\"\/cta-blocks\/assets\/images\/arrow-icon.svg\" class=\"close\">\r\n-->      <img decoding=\"async\" class=\"arrow-icon purple\" src=\"https:\/\/10web.io\/blog\/wp-content\/plugins\/cta-blocks\/assets\/images\/arrow-icon-purple.svg\" class=\"close\">\r\n  <\/span>\r\n<\/div>\r\n<br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTTP 504 Gateway Timeout and HTTP 502 Bad Gateway errors are the most common server errors for WordPress website visitors and owners. In my previous article, we discussed the causes of a 504 Gateway Timeout error and possible solutions. In this article, we\u2019ll come to understand what a 502 Bad Gateway error is, talk about the reasons for a 502&#8230;<\/p>\n","protected":false},"author":79,"featured_media":24609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"two_page_speed":[],"footnotes":"","tenweb_blog_toc":"<ul><li><a href=\"#faq\">FAQ<\/a><li><a href=\"#what-does-502-bad-gateway-mean\">What does 502 Bad Gateway mean?<\/a><li><a href=\"#what-is-a-502-bad-gateway-error\">What is a 502 Bad Gateway error?<\/a><li><a href=\"#the-various-forms-of-502-errors\">The various forms of 502 errors<\/a><ul><li><a href=\"#custom-502-pages\">Custom 502 pages<\/a><\/li><\/ul><li><a href=\"#what-are-the-reasons-behind-the-502-bad-gateway-error\">What are the reasons behind the 502 Bad Gateway error?<\/a><li><a href=\"#how-to-troubleshoot-a-502-error-message\">How to troubleshoot a 502 error message<\/a><ul><li><a href=\"#reload-the-page\">Reload the page<\/a><li><a href=\"#check-if-the-website-is-down\">Check if the website is down<\/a><li><a href=\"#try-a-different-browser\">Try a different browser<\/a><li><a href=\"#checking-in-an-incognito-window\">Checking in an incognito window<\/a><li><a href=\"#check-using-a-different-device\">Check using a different device<\/a><li><a href=\"#check-your-internet-connection\">Check your internet connection<\/a><li><a href=\"#clear-browser-cache-and-cookies\">Clear browser cache and cookies<\/a><li><a href=\"#flush-dns-cache\">Flush DNS cache<\/a><li><a href=\"#change-dns-servers\">Change DNS servers<\/a><li><a href=\"#disable-vpn-or-proxy\">Disable VPN or proxy<\/a><li><a href=\"#check-for-updates\">Check for updates<\/a><\/li><\/ul><li><a href=\"#impact-of-502-errors-on-seo\">Impact of 502 errors on SEO<\/a><ul><li><a href=\"#short-term-vs-long-term-downtime\">Short-term vs. long-term downtime<\/a><li><a href=\"#mitigating-seo-impact\">Mitigating SEO impact<\/a><\/li><\/ul><li><a href=\"#correcting-502-errors-on-your-website\">Correcting 502 errors on your website<\/a><ul><li><a href=\"#check-server-health\">Check server health<\/a><li><a href=\"#review-recent-changes\">Review recent changes<\/a><li><a href=\"#restart-php\">Restart PHP<\/a><li><a href=\"#restart-php-fpm-service\">Restart PHP-FPM service<\/a><li><a href=\"#timeout-issues\">Timeout issues<\/a><li><a href=\"#update-wordpress-plugins-and-themes\">Update WordPress, plugins, and themes<\/a><li><a href=\"#consult-server-logs\">Consult server logs<\/a><li><a href=\"#check-plugins-and-themes-for-conflicts\">Check plugins and themes for conflicts<\/a><li><a href=\"#increase-php-memory-limit\">Increase PHP memory limit<\/a><li><a href=\"#check-htaccess-file\">Check .htaccess file<\/a><li><a href=\"#review-cdn-settings\">Review CDN settings<\/a><li><a href=\"#502-bad-gateway-errors-with-cloudflare\">502 bad gateway errors with Cloudflare<\/a><li><a href=\"#check-for-server-side-firewalls\">Check for server-side firewalls<\/a><li><a href=\"#contact-hosting-provider\">Contact hosting provider<\/a><\/li><\/ul><li><a href=\"#navigating-through-the-502-bad-gateway-fog\">Navigating through the 502 bad gateway fog<\/a><\/li><\/ul>","tenweb_blog_competitor_type":"","tenweb_blog_competitor_names":"","tenweb_blog_twb_version":0,"tenweb_blog_type":"on"},"categories":[500],"tags":[439],"class_list":["post-17058","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-http-errors","tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>502 Bad Gateway? Here\u2019s How to Resolve It<\/title>\n<meta name=\"description\" content=\"HTTP 502 Bad Gateway errors are the most common server errors. Here are some tips on how you can troubleshoot this kinds of errors.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/10web.io\/blog\/502-bad-gateway\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"502 Bad Gateway Error and How to Fix It\" \/>\n<meta property=\"og:description\" content=\"HTTP 502 Bad Gateway errors are the most common server errors. Here are some tips on how you can troubleshoot this kinds of errors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/10web.io\/blog\/502-bad-gateway\/\" \/>\n<meta property=\"og:site_name\" content=\"10Web - Build &amp; Host Your WordPress Website\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/10Web.io\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-06T16:00:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-12T17:58:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/502-bad-gateway.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1484\" \/>\n\t<meta property=\"og:image:height\" content=\"848\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Arto Minasyan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@artavazdm\" \/>\n<meta name=\"twitter:site\" content=\"@10Web_io\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arto Minasyan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"31 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"502 Bad Gateway? Here\u2019s How to Resolve It","description":"HTTP 502 Bad Gateway errors are the most common server errors. Here are some tips on how you can troubleshoot this kinds of errors.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/10web.io\/blog\/502-bad-gateway\/","og_locale":"en_US","og_type":"article","og_title":"502 Bad Gateway Error and How to Fix It","og_description":"HTTP 502 Bad Gateway errors are the most common server errors. Here are some tips on how you can troubleshoot this kinds of errors.","og_url":"https:\/\/10web.io\/blog\/502-bad-gateway\/","og_site_name":"10Web - Build &amp; Host Your WordPress Website","article_publisher":"https:\/\/www.facebook.com\/10Web.io\/","article_published_time":"2021-05-06T16:00:30+00:00","article_modified_time":"2026-03-12T17:58:38+00:00","og_image":[{"url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/502-bad-gateway.png","width":1484,"height":848,"type":"image\/png"}],"author":"Arto Minasyan","twitter_card":"summary_large_image","twitter_creator":"@artavazdm","twitter_site":"@10Web_io","twitter_misc":{"Written by":"Arto Minasyan","Est. reading time":"31 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#article","isPartOf":{"@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/"},"author":{"name":"Arto Minasyan","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/b2a531cd7f3eb7353f839f77c203007e"},"headline":"502 Bad Gateway Error and How to Fix It","datePublished":"2021-05-06T16:00:30+00:00","dateModified":"2026-03-12T17:58:38+00:00","mainEntityOfPage":{"@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/"},"wordCount":5705,"commentCount":0,"publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"image":{"@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/502-bad-gateway.png","keywords":["wordpress"],"articleSection":["HTTP Errors"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/10web.io\/blog\/502-bad-gateway\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/","url":"https:\/\/10web.io\/blog\/502-bad-gateway\/","name":"502 Bad Gateway? Here\u2019s How to Resolve It","isPartOf":{"@id":"https:\/\/10web.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#primaryimage"},"image":{"@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#primaryimage"},"thumbnailUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/502-bad-gateway.png","datePublished":"2021-05-06T16:00:30+00:00","dateModified":"2026-03-12T17:58:38+00:00","description":"HTTP 502 Bad Gateway errors are the most common server errors. Here are some tips on how you can troubleshoot this kinds of errors.","breadcrumb":{"@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/10web.io\/blog\/502-bad-gateway\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#primaryimage","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/502-bad-gateway.png","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2023\/12\/502-bad-gateway.png","width":1792,"height":1024,"caption":"A man frustrated by a 502 bad gateway error."},{"@type":"BreadcrumbList","@id":"https:\/\/10web.io\/blog\/502-bad-gateway\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/10web.io\/blog\/"},{"@type":"ListItem","position":2,"name":"502 Bad Gateway Error and How to Fix It"}]},{"@type":"WebSite","@id":"https:\/\/10web.io\/blog\/#website","url":"https:\/\/10web.io\/blog\/","name":"10Web Blog - Build & Host Your WordPress Website","description":"10Web is an All-in-One Website Building Platform, offering Managed WordPress Hosting on Google Cloud, Beautiful Templates, Premium Plugins and Services.","publisher":{"@id":"https:\/\/10web.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/10web.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/10web.io\/blog\/#organization","name":"10Web","url":"https:\/\/10web.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2025\/04\/Logo-768x686-1.png","contentUrl":"https:\/\/10web.io\/blog\/wp-content\/uploads\/sites\/2\/2025\/04\/Logo-768x686-1.png","width":768,"height":686,"caption":"10Web"},"image":{"@id":"https:\/\/10web.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/10Web.io\/","https:\/\/x.com\/10Web_io","https:\/\/www.instagram.com\/10web.io\/","https:\/\/www.linkedin.com\/company\/10web\/mycompany\/","https:\/\/www.youtube.com\/c\/10Web"]},{"@type":"Person","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/b2a531cd7f3eb7353f839f77c203007e","name":"Arto Minasyan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/10web.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9b1112aab2e31af3c41be33bdfc49a63?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9b1112aab2e31af3c41be33bdfc49a63?s=96&d=mm&r=g","caption":"Arto Minasyan"},"description":"Arto Minasyan is the Co-Founder and President at 10Web and Krisp, two companies revolutionizing web development and audio communications. Arto has over 10 years of experience building and leading cutting-edge teams and products in the tech industry. His passion for AI, machine learning, and entrepreneurship drives the success of the projects he leads.","sameAs":["https:\/\/10web.io\/","https:\/\/www.linkedin.com\/in\/artominasyan\/","https:\/\/x.com\/artavazdm"],"honorificSuffix":"PhD","knowsAbout":["Artificial Intelligence","Machine Learning","Web Development","Entrepreneurship","WordPress","WooCommerce","Startup Funding","SaaS Development","Physics & Mathematics"],"jobTitle":"Co-Founder & President","worksFor":"Arto Minasyan","url":"https:\/\/10web.io\/blog\/author\/arto\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/17058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/users\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/comments?post=17058"}],"version-history":[{"count":0,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/posts\/17058\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media\/24609"}],"wp:attachment":[{"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/media?parent=17058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/categories?post=17058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/10web.io\/blog\/wp-json\/wp\/v2\/tags?post=17058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}