我已经使用SSL实现了Private_Pub,并按照以下建议通过端口4443运行:https://github.com/ryanb/private_pub#serving-faye-over-https-with-thin
但是,每当我实际使用private_pub服务时,我都会收到以下错误:
Errno :: ETIMEDOUT:连接超时 - 连接(2)for" www.mysite.com" 4443号港口
真正奇怪的是,在我们迁移提供商之前,它正在另一台服务器上工作。
我已确保端口4443通过telnet成功打开。我玩nginx配置没有任何运气。我已经多次重启瘦服务器只是为了看看我是否幸运。
我可以访问:https://www.mysite.com:4443/faye/faye.js
有人能指出我正确的方向吗?
编辑:添加了我的nginx配置文件:
worker_processes 1;
error_log /var/log/nginx.log debug;
events {
worker_connections 1024;
}
http {
passenger_root /home/me/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.52;
passenger_ruby /home/me/.rvm/gems/ruby-2.1.2/wrappers/ruby;
passenger_app_env production;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
root /var/www/mysite/current/public;
rails_env production;
passenger_enabled on;
}
server {
listen 443;
root /var/www/mysite/current/public;
rails_env production;
proxy_read_timeout 1200;
client_max_body_size 20m;
error_log /var/log/nginx.log debug;
ssl on;
ssl_certificate /var/server.crt;
ssl_certificate_key /var/server.key;
proxy_set_header X-Forwarded-Proto: https;
passenger_pass_header X-Forwarded-Proto;
passenger_enabled on;
# Tried it also without this part to no avail
location /faye {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
root /var/applications/current/faye;
proxy_pass http://127.0.0.1:4443;
break;
}
}
server {
listen 80;
listen 443;
server_name www.mysite.co mysite.co;
return 302 $scheme://www.mysite.com$request_uri;
}
}