在带有 nginx 1.10.2 和 uwsgi 2.0.14 的 centos 7 上
当我配置 uwsgi 在 /var/tmp/uwsgi 或 /tmp 中打开套接字时,我从 nginx 收到一条消息,说它找不到套接字文件:
2017/06/07 16:54:53 [crit] 2642#0: *7 connect() to unix:///tmp/mywebsite.socket failed (2: No such file or directory) while connecting to upstream, client: 108.162.245.185, server: _, request: "GET /share/3years/music/guitarists/django_reinhardt HTTP/1.1", upstream: "uwsgi://unix:///tmp/mywebsite.socket:", host: "mywebsite.com"
2017/06/07 17:22:11 [crit] 1327#0: *2 connect() to unix:///var/tmp/uwsgi/mywebsite.socket failed (2: No such file or directory) while connecting to upstream, client: 5.158.200.123, server: _, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///var/tmp/uwsgi/mywebsite.socket:", host: "mywebsite.com"
如果我使用“unix:///var/uwsgi/mywebsite.socket”(不带“/tmp/”)则完全没有问题。在三种情况下,目录位于 1777,套接字文件权限授予 nginx 用户读/写访问权限,并且 nginx 套接字路径与配置文件中的 uwsgi 套接字路径匹配。SELinux 已禁用。
那么为什么我不能使用 /var/tmp 或 /tmp 为 nginx/uwsgi 创建套接字:很多示例都说这是可能的?