I get a 502 bad gateway ONLY with a specific combination of domain/root folders - NGINX

Posted by Patrick De Amorim on Server Fault See other posts from Server Fault or by Patrick De Amorim
Published on 2012-06-12T04:18:20Z Indexed on 2012/06/12 4:41 UTC
Read the original article Hit count: 593

Filed under:

I have a VPS running NGINX and virtual hosts, with a configuration such as this:

Domains directing to it:

lolpics.no
smscloud.no
idmag.no

Root folders:

/home/vds/www/lolpics
/home/vds/www/smscloud
/home/vds/www/idmag

SMSCloud.no is the site that keeps getting 502 errors, but if I make the domain direct to any of the other folders, the site works, or if I make any other domain name direct to the /home/vds/www/smscloud folder, it works. Only smscloud.no with /home/vds/www/smscloud breaks

I tried putting this between the http{} in my nginx.conf and no help:

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

EDIT: Well, that was slightly silly, if anyone from Google stumbles on this, here's how I fixed it, I just added this to the http{}:

fastcgi_buffer_size  16k;
fastcgi_buffers      16  16k;

So that the start of my http block is:

http {
    include       /etc/nginx/mime.types;
    proxy_buffer_size   128k;
    proxy_buffers   4 256k;
    proxy_busy_buffers_size   256k;

    fastcgi_buffer_size  16k;
    fastcgi_buffers      16  16k;

© Server Fault or respective owner

Related posts about nginx