3个文件簇(err.log,chat.yml,Nginx的chat.conf):
err.log:
2015/03/19 15:05:50 [crit] 1535#0: *79 connect() to unix:/var/www/chat/public/tmp/sockets/thin.0.sock failed (2: No such file or directory) while connecting to upstream, client: 162.243.6.35, server: chat.stackin.money, request: "GET / HTTP/1.1", upstream: "http://unix:/var/www/chat/public/tmp/sockets/thin.0.sock:/", host: "chat.stackin.money" 2015/03/19 15:05:50 [crit] 1535#0: *79 connect() to unix:/var/www/chat/public/tmp/sockets/thin.1.sock failed (2: No such file or directory) while connecting to upstream, client: 162.243.6.35, server: chat.stackin.money, request: "GET / HTTP/1.1", upstream: "http://unix:/var/www/chat/public/tmp/sockets/thin.0.sock:/", host: "chat.stackin.money"
chat.conf:
upstream stackin_money { ip_hash; server unix:/var/www/chat/public/tmp/sockets/thin.0.sock max_fails=1 fail_timeout=15s; server unix:/var/www/chat/public/tmp/sockets/thin.1.sock max_fails=1 fail_timeout=15s; } server { listen 80; server_name chat.stackin.money; location / { proxy_pass http://stackin_money; proxy_set_header HOST $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } root /var/www/chat/public; # access_log /var/log/nginx/access.log; # error_log /var/log/nginx/error.log; }
chat.yml:
user: root group: root pid: tmp/pids/thin.pid timeout: 30 wait: 30 log: /var/log/thin/thin.log max_conns: 1024 require: [] environment: production max_persistent_conns: 512 servers: 2 onebyone: true threaded: true no-epoll: true daemonize: true socket: tmp/sockets/thin.sock chdir: /var/www/chat/public tag: chat aux
所以我正在运行一个使用thin作为实时聊天的服务器的sinatra应用程序,因为我希望在一个子域上运行,我使用Nginx来反向代理。 然而,我遇到了一些Nginx或者Thin(Nginx的错误日志错误)的问题,它无法find我在Thin sockets的chat.yml中指定的文件或目录(下面)。 它是真的,它根本就没有。
任何帮助? 提前致谢
查看/ var / www / chat / public / tmp / sockets / – thin.0.sock实际上是否存在? 据我所知,Thin只支持TCP套接字,而不是Unix套接字。 如果你从一个独angular兽的例子中复制了Unix套接字的东西,那就可以解释它,因为Unicorn确实支持它们。
我build议改变上游定义块来说server http://127.0.0.1:4567或类似的东西(无论使用瘦过程的端口)。