502 Bad Gateway- Nginx and thin

Francis Daly francis at daoine.org
Mon Mar 18 20:24:43 UTC 2013

On Mon, Mar 18, 2013 at 08:53:10PM +0100, Yunior Miguel A. wrote:

Hi there,

I see that I was wrong in assuming how thin works.

> thin configuration:

> servers: 1
> socket: /tmp/thin.sock

It looks like the *actual* file name used for the socket can add a
".integer" before the final "." in the configured socket file name,
with the integer going from 0 up to one below the number of servers.

So this bit:

> ngin configuration:
> upstream thin_cluster {
>     server unix:/tmp/thin.0.sock;
>    # server unix:/tmp/thin.1.sock;
>    # server unix:/tmp/thin.2.sock;
> }

is correct, despite looking odd to my non-thin eyes.

It's good that you found a configuration that works for you.

>From the initial error message reported, I can only assume that thin
wasn't running in that mode at the time you tested.

Francis Daly        francis at daoine.org

More information about the nginx mailing list