Have you ever encountered 502 bad gateway errors on your site at what seems to be random intervals? Then you’ll know the frustration of not understanding why and how to sort this problem.

99% of the time a 502 bad gateway error is web server related and not the user browser.

It can be a number of things but if you have an apache with nginx reverse proxy setup then the problem might be rectifiable with a simple nginx config addition.

All you may need to do is add the following two lines to your /etc/nginx/nginx.conf file (bolded below)

http {

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;


I hope I help someone out by posting about this!

Thanks for reading

As always: Comments Welcome!