Fix 502 Bad Gateway in Wordpress

Fix 502 Bad Gateway in WordPress

Introduction

First of all, don’t panic!

If you encountered 502 Bad Gateway on WordPress or any error it’s always better if you stay calm. So, each time you open a webpage, the browser throw requests to other web servers. The servers at that point handle these requests and send back a HTTP status code along with the resources asked by the webpage. For example, webpage files like stylesheets, javascripts, images, content, SVGs, etc. For the most part, the HTTP status codes are not shown except if the server experienced the issue on route. This is the manner by which the servers tells one another and the end-client what turned out wrong.

HTTP status codes that begin with the digit “5” identify with errors that happen when there’s a miscommunication between a few servers. Despite the fact that the reason behind their appearance varies, most of the time the reason exists in the server-side.

What is 502 bad gateway?

Getting a 502 bad gateway error on WordPress or any other platform implies that the source server sent out an invalid response to other server. These servers that act as a gateway proxy. Consider all requests on the webpage have different gateways, it can be tricky to find the correct point or process which caused the issue. In any case, there are general steps to troubleshoot this error and get it right.

This post is for the individuals who experienced this error in WordPress. Most of the WordPress themes nowadays has page builder. These page builders allows you to create, edit, and customize the web page without writing any code. Which is very handy for small companies or individuals who wants to have an identity online.

How do these page builders affect the webpage and end up getting a 502 Bad Gateway? It’s simply because these page builders have too many assets or sources. And, the client server can’t handle or most of the time has a limit. The reason why the requests route broke.

Solution

Add the following code at the very bottom of your .htaccess file. Which should be inside the root of your WordPress folder.


SubstituteMaxLineLength 25M