部署 Unicorn tcpsocket 通讯模式

hiveer · 2014年04月04日 · 最后由 hiveer 回复于 2014年04月08日 · 2214 次阅读

发现 Unicorn 并没有打开指定端口 配置

nginx
  upstream app_server {
    # fail_timeout=0 means we always retry an upstream even if it failed
    # to return a good HTTP response (in case the Unicorn master nukes a
    # single worker for timing out).

    # for UNIX domain socket setups:
    #server unix:/path/to/.unicorn.sock fail_timeout=0;    

    # for TCP setups, point these to your backend servers
    # server 192.168.0.7:8080 fail_timeout=0;
    # server 192.168.0.8:8080 fail_timeout=0;    
    server 192.168.1.4:8080 fail_timeout=0;
  }
unicorn
#listen "/tmp/#{application}.sock", :backlog => 256
listen "127.0.0.1:8080"

这导致了 nginx 没法访问 unicorn

你 listen 的是 127.0.0.1 外界当然访问不到了 只能本机 127.0.0.1 访问 虽然你也是本机的 nginx 但是 192.168.1.4 也是被认为通过外界访问的

@zj0713001 你说的是对的,这个问题解决了。谢谢!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号