3

我正在尝试在我的服务器上的 ip 上配置私人 pub,相同的配置之前在不同的服务器上工作,但在当前不工作。

config/private_pub.yml

development:
  server: "http://52.76.xx.xx:9292/faye"
  #server: "http://faye.myserver.com/faye"
  secret_token: "secret"
test:
  server: "http://localhost:9292/faye"
  secret_token: "secret"
production:
  server: "http://example.com/faye"

private_pub.ru

# Run with: rackup private_pub.ru -s thin -E production
require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"

Faye::WebSocket.load_adapter('thin')

PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
run PrivatePub.faye_app

当我跑步时,rackup private_pub.ru -s thin -E production我在下面

Thin web server (v1.6.4 codename Gob Bluth)
Maximum connections set to 1024
Listening on localhost:9292, CTRL+C to stop

但是当我尝试卷曲或在浏览器中调用时,我得到

Connection refused - connect(2) for "52.76.xx.xx" port 9292

我还尝试使用指向faye服务器的相同IP的单独域并将其代理到localhost:9292如下

server {
        listen       80;
        server_name  faye.myserver.com www.faye.myserver.com;
       # passenger_enabled on;

        location / {
            proxy_pass http://localhost:9292;
        }    
#       passenger_app_env production;
    }

但这也没有用。你能告诉我如何解决这个问题吗?

4

0 回答 0