Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal + Nginx + Php-cgi : 502 Bad Gateway error

We are running Drupal 5.x on Nginx with php-fastcgi. Things were working fine for a while. All of a sudden, we (users) are running into 502 Bad Gateway error. Restarting PHP-cgi, nginx.. rebooting machine etc did not help.

Did anyone else run into this type of issue? What are the possible suspects?

like image 755
Neil Avatar asked Oct 03 '09 19:10

Neil


People also ask

Why do I keep getting bad gateway 502?

A 502 bad gateway message indicates that one server got an invalid response from another. In essence, you've connected with some kind of interim device (like an edge server) that should fetch all of the bits you need to load the page. Something about that process went wrong, and the message indicates the problem.

How can I fix my amino 502 Bad gateway?

Clear Your Browser's Cache and Cookies If trying a different browser works, it's possible that your main browser has cached outdated or corrupt files that might be causing the 502 error. Removing these cached files and trying to open the website could solve the problem.

What causes a 502 Proxy Error?

The HTTP 502 - bad gateway error occurs when either: The timeout of the proxy was reached prior to the request completion. If the connection proxy > server drops. When the response from the server is invalid.


1 Answers

Today I was getting “502 Bad Gateway” on a CI project , after digging into the problem I found out it is a problem of nginx fastcgi buffers , here is how to fix it : open /etc/nginx/nginx.conf

add the following lines into http section :

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
like image 101
Govind Totla Avatar answered Sep 19 '22 06:09

Govind Totla