I have application that runs under nginx with unicorn. But sometimes it gives me the 502 bad gateway, and I'm not even trying to load a big page.
Also, my nginx just stops responding weirdly. I can see the request on my server but nothing happens.
My question is how can my nginx works properly with unicorn? Is there any tutorials or articles which could help me with this?
Well, I was receiving this 502 for many reasons...
1) my web site wasn't optimized, there were too much ruby code on the views.
2)I was storing some images on Dropbox service, which was extremely slow (we changed to amazon, works great!).
3)I was running the application on a server of 700MB RAM, which using unicorn (that cosumes the shit out of the memory) was terrible. So we changed to puma (much better).