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_buffers 4 256k;