Fixing a 502 / bad gateway error if you’re running NGINX

I came across this issue when trying to switch between users in a WordPress multi site installation. After some research it looked as though configuring NGINX buffers may solve the problem – and it did.

In my case the issue presented itself on a Plesk installation on Vultr.

If you’re getting something similar, then when you’re in Plesk, head over to Websites & Domains / Apache & NGINX Settings.

Look for Additional NGINX directives and add the following:

proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

Interested in talking about WordPress?