Search code examples
socketspermissionsnginxthinruby-1.9

Nginx + Thin socket permission error == Bad Gateway


I've had Nginx & Thin playing nicely on Ubuntu 10.04 for a couple of years. I have a script in /etc/init.d that starts Thin, using some .yml files in /etc/thin.

All of a sudden restarting Thin for any reason causes a permission denied error in Nginx.

Thin is running on a couple of sockets in /tmp, owned by root. I don't know if that was always the case...but if I change the owner of the socket to www-data (used by Nginx) everything works fine. So I wrote another script to handle it.

Thin is running v1.2.7, and Nginx is 0.7.65. Neither has changed. I did upgrade to Ruby 1.9.3p194 from 1.9.2p290.

Does anybody else have this issue, and have you found a more reasonable fix than "manually" updating permissions?


Solution

  • Upgrading Thin to 1.3.1 solved it. I should've tried that right away, but I had issues with a staging server.

    Anyway. Maybe this will help someone else.