I keep getting random "502 Bad Gateway - nginx" errors cropping up on a clients website when using Cart Throb.

For example I tried to install the example templates & chanmels inside Cart Throb, but it through the 502 error, when it got to this URL:


It also does it sometimes when a customer pays for something, using the SagePay gateway.

What could be causing this? I've tried turning off secure forms in the settings and its still doing it.

1 Answer 1


You may have already resolved this, but in case you haven't or for anyone else running into this issue, I resolved it by adding the following to my nginx.conf file within the http {} tags located at /etc/nginx/nginx.conf on your server:

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

Then restart your nginx service via SSH with the following command:

'service nginx restart'

This worked for me, but for some others the fastcgi_buffer also needed to be updated. If the above does not work, then you may want to reference this answer:

Upstream too big - nginx + codeigniter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.