我正在尝试使用弹性 IP 在 Centos EC2 实例上部署 Node.js Web 应用程序。SSL 证书已设置并正确配置。我想仅允许 https 连接到我的应用程序,但我收到以下错误:
[错误] 2471#0: *1 connect() 连接到上游时失败(111:连接被拒绝)。
这是我的 NGINX(v 1.6.1)配置文件:
server {
listen 80 default;
server_name example.com www.example.com;
## redirect http to https ##
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443 ssl;
server_name example.com www.example.com;
root /usr/share/nginx/html;
client_max_body_size 20M;
if ($host = 'www.example.com' ) {
rewrite ^/(.*)$ https://example.com/$1 permanent;
}
ssl_certificate /etc/ssh/ssl-bundle.crt;
ssl_certificate_key /etc/ssh/com.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
## Node.js specific##
location / {
proxy_pass http://127.0.0.1:3000/;
}
}