Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using Nginx As a load balancer for multiple riak nodes. The setup worked fine for some time(few hours) before Nginx started giving bad gateway 502 errors. On checking the individual nodes seemed to be working. We found out that The problem was with nginx buffer size hence increased the buffer size to 16k, it worked fine for one more day before we started getting 502 error for everything.

My Nginx configuration is as follows

upstream riak {
   server weight=3;


  server {
    listen 8098;
    location / {
      proxy_pass http://riak;
      proxy_buffer_size 16k;
      proxy_buffers 8 16k;

Any help is appreciated,Thank you.

share|improve this question
Anything interesting in logs? –  Shane Madden Jan 3 '12 at 16:46
nothing in error logs and in access logs it shows 502. –  djd Jan 4 '12 at 4:57
502 is a clear indication that the backend failed to respond. Check the backend logs, you should find the problem there. It could be the backend is taking longer than 60sec (the default timeout) to respond hence the 502. –  Sameer Feb 6 '12 at 11:41
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.