Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I use fedora 17, and when I setup nginx with uwsgi using unix domain socket, when I place the socket in a directory with proper permission it's ok, but when I place the socket in the /tmp it will cause nginx error:

connect() to unix:/tmp/MySite.sock failed (2: No such file or directory) while connecting to upstream

The file does exist and has read/write permission for nginx user. But what cause this error, its really drive me crazy, can somebody figure it out.

share|improve this question

1 Answer 1

up vote 15 down vote accepted

You can't place sockets intended for interprocess communication in /tmp.

For security reasons, recent versions of Fedora use namespaced temporary directories, meaning every service sees a completely different /tmp and can only see its own files in that directory.

To resolve the issue, place the socket in a different directory, such as /run (formerly known as /var/run).

share|improve this answer
its really helpful, thank you – jeffgoku Jan 8 '13 at 15:34
/run is not writable for a regular user though – hostmaster Dec 12 '14 at 9:26
/run is not writable directly, but you can instruct systemd to create a directory under it which is writable by both processes. – Michael Hampton Mar 4 at 13:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.