Short answer:
Not nginx-related (you are on the nginx mailing list).
Long answer:
As your log clearly indicates, your upstream sometimes fails either by
resetting connections improperly or even by not accepting them at all.
Everything indicates your backend does not sustain the load.
The most troublesome part is IMHO the fact it kills active connections
improperly. Try to get information on what happens on the backend
machine.
See if something like shortage of file descriptors or anything leading
to
connection disruption.
One thing you could do to alleviate the load on the backend with the
current setup would be to add cache where you proxy/redirect requests to
your backend (See *_cache directives, depending on the module you are
using).
B. R.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.