我正在尝试在我的服务器上使用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;
}
但那也行不通。你能告诉我如何解决这个问题吗?