{"id":26121,"date":"2023-02-20T07:59:43","date_gmt":"2023-02-20T07:59:43","guid":{"rendered":"http:\/\/localhost\/helpold\/?p=26121"},"modified":"2023-02-20T07:59:43","modified_gmt":"2023-02-20T07:59:43","slug":"what-is-the-bad-gateway-error-and-how-can-it-be-resolved","status":"publish","type":"post","link":"https:\/\/www.arvancloud.ir\/help\/en\/what-is-the-bad-gateway-error-and-how-can-it-be-resolved\/","title":{"rendered":"What is the Bad Gateway Error and How Can it be Resolved?"},"content":{"rendered":"<p style=\"text-align: left\">One of the errors that users of ArvanCloud accelerated and secured websites may encounter is the \u201cwebsite main server\u201d out of access error. This error message indicates that the main server is temporarily unavailable . ArvanCloud displays this message as the default when the original server returns one of the 500, 502, 503 or 504 errors.<\/p>\n<h3 style=\"text-align: left\"><strong>A Look at the 502 and 504 Error Codes<\/strong><\/h3>\n<p style=\"text-align: left\">HTTP errors related to the 5xx family indicate a server problem that makes it unable to respond. These error codes are sent in Response format in exchange for requests received from the user (browser or edge server CDN).<\/p>\n<h4 style=\"text-align: left\"><strong>502 Error Code:\u00a0Bad Gateway<\/strong><\/h4>\n<p style=\"text-align: left\">This error code is displayed to the user when the ArvanCloud edge server receives an invalid response from the website\u2019s main server. This error may occur due to the following reasons:<\/p>\n<ul style=\"text-align: left\">\n<li><strong>Inaccessibility of the website\u2019s main host server:<\/strong>\u00a0This could be due to a sudden increase in the amount of traffic sent to the server, increasing overhead and as a result, inaccessibility or loss of connection between the ArvanCloud edge server and the website\u2018s main host server.<\/li>\n<li><strong>Requests getting blocked by the firewall:<\/strong>\u00a0Requests sent by the ArvanCloud edge server to the website\u2019s main host server are sometimes blocked by a firewall between these servers. This may be caused by high sensitivity DDoS mitigation systems.<\/li>\n<li>The requested service or application being blocked on the website\u2019s main host server.<\/li>\n<\/ul>\n<h4 style=\"text-align: left\"><\/h4>\n<h4 style=\"text-align: left\"><strong>Resolving Error 502<\/strong><\/h4>\n<p style=\"text-align: left\">You can take the following actions on the website\u2019s main host server to resolve error 502:<\/p>\n<ul style=\"text-align: left\">\n<li>Investigate server accessibility using tools such as ping or traceroute<\/li>\n<li>Investigate firewall logs by observing unusual drops.<\/li>\n<\/ul>\n<h4 style=\"text-align: left\"><\/h4>\n<h4 style=\"text-align: left\"><strong>Error 504:\u00a0Gateway Timeout<\/strong><\/h4>\n<p style=\"text-align: left\">This error is displayed whenever the ArvanCloud edge server doesn\u2019t receive a response from the main server in a specified time. This error is displayed for the following reasons:<\/p>\n<ul style=\"text-align: left\">\n<li>Inaccessibility of or functional problems with the website\u2019s main host server<\/li>\n<li>Requests getting dropped due to a firewall on the route between the main web server and the CDN edge server.<\/li>\n<\/ul>\n<p style=\"text-align: left\">\n<h4 style=\"text-align: left\"><strong>Resolving Error 504<\/strong><\/h4>\n<p style=\"text-align: left\">You can take the following actions on the website\u2019s main host server to resolve error 504:<\/p>\n<ul style=\"text-align: left\">\n<li>Adding ArvanCloud IPs to the firewall and server side limitations whitelist<\/li>\n<li>Checking to make sure the website&#8217;s main host server is functioning properly<\/li>\n<\/ul>\n<p style=\"text-align: left\">Although Ping and Trace Route can be used to test the main host server\u2019s accessibility, MTR is a more powerful tool that can provide more information in this regard.<\/p>\n<h3 style=\"text-align: left\"><\/h3>\n<h3 style=\"text-align: left\"><strong>Important Points Regarding \u201cWebsite Main Host Server\u201d Inaccessibility Error<\/strong><\/h3>\n<ul style=\"text-align: left\">\n<li>This error message indicates an error on the website\u2019s main server, and is not related to ArvanCloud.<\/li>\n<li>Errors on the main servers are mostly temporary and may be displayed for a specific group of users for a few moments before getting resolved.<\/li>\n<li>In many cases, the problem could reside with the links connecting the web content host datacenter, and there may be no problems on the website\u2019s main server.<\/li>\n<li>This error is not related to security issues, and is often related to large traffic volume from users, communications links, or website accessibility status.<\/li>\n<li>Using the default (automatic) setting to establish connections between your website\u2019s main host server and the ArvanCloud edge server while a specific port on your main server is blocked is another important reason why you may encounter the ArvanCloud error when trying to visit the website. According to the request sent by the user, the connection between our servers and your website\u2019s main host server is based on HTTP or HTTPS in automatic mode. The ArvanCloud error will be displayed to users immediately if the 80 (HTTP protocol port number) or 443 (HTTPS protocol port number) port is blocked on your main server and the user sends a request on this port. If you have closed a port on your website\u2019s main host server and are trying to make communications follow a particular protocol (like HTTPS), go to Content Distribution Network (CDN), origin settings, and select your desired protocol from the main server connection protocol (default setting) to resolve this issue, like the following picture. Note that what you specify here will also be applied to activation records. You can read \u201cactivation settings on the ArvanCloud user panel\u201d to better understand the activation section.<\/li>\n<li><img decoding=\"async\" src=\"https:\/\/arvancloud.zendesk.com\/hc\/article_attachments\/360011418120\/mceclip0.png\" alt=\"mceclip0.png\" \/><\/li>\n<\/ul>\n<h3 style=\"text-align: left\"><\/h3>\n<h3 style=\"text-align: left\"><strong>Customizing Error Pages in the ArvanCloud Panel<\/strong><\/h3>\n<p style=\"text-align: left\">The ArvanCloud panel makes it possible for users to use their customized error pages instead of default ArvanCloud error pages if they so desired. You can go to the ArvanCloud panel and then to \u201cContent Distribution Network (CDN)\u201d and select your preferred mode from \u201ccustomize errors\u201d.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the errors that users of ArvanCloud accelerated and secured websites may encounter is the \u201cwebsite main server\u201d out of access error. This error message indicates that the main server is temporarily unavailable . ArvanCloud displays this message as the default when the original server returns one of the 500, 502, 503 or 504 [&hellip;]<\/p>\n","protected":false},"author":79,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"r1_post_views_count":"1869","feedback_yes":"1","feedback_no":"","ads_id_sidebar":"","ads_id_content":"","footnotes":""},"categories":[249,273],"tags":[],"class_list":["post-26121","post","type-post","status-publish","format-standard","hentry","category-cdn","category-cdn-troubleshooting"],"lang":"en","translations":{"en":26121},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/users\/79"}],"replies":[{"embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/comments?post=26121"}],"version-history":[{"count":0,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/posts\/26121\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/media?parent=26121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/categories?post=26121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.arvancloud.ir\/help\/wp-json\/wp\/v2\/tags?post=26121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}