Nginx cannot find unix socket file with Unicorn (no such file or directory)

风流意气都作罢 提交于 2019-11-28 16:31:03
jamsesso

After many hours and a grand total of 3 beers, I've managed to figure out the problem. After hours of digging, I finally came across this Server Fault answer

In layman terms, it appears that programs that create files in /tmp (or /var/tmp as I have discovered) are the only programs that are able to see the files in that directory. Unicorn was creating the UNIX socket file, however Nginx could not see it.

The solution I have employed is to have Unicorn create sockets in /var/sockets.

I suddenly had a similar situation after changing nginx to use a systemd startup service based on their template.

It ends up that the problem was with PrivateTmp=true, which makes it so that nginx was unable to access the socket file created by gunicorn. Once I changed this to PrivateTmp=false the error resolved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!