【发布时间】:2016-04-18 23:23:16
【问题描述】:
我有一个简单的 NGINX 代理配置(如下),它使用我的新 SSL 证书(我第一次尝试这个)。
我通过 Docker 部署了它,扩展了标准的“nginx”镜像。我有理由确定我的 InstantSSL 证书文件是有效的,但服务器没有返回有效的 SSL 连接。
我收到以下错误:
$ openssl s_client -connect MY_DOMAIN.com:443
CONNECTED(00000003)
22489:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake
我也尝试过其他工具:
$ ./cipherscan -v https://MY_DOMAIN.com
handshake failed, no ciphersuite was returned
最后,https://www.ssllabs.com/ssltest/analyze.html 返回“不支持安全协议”
我尝试了 ssl_protocols 和 ssl_ciphers 设置的各种组合,但 nginx 文档说默认设置应该没问题。
NGINX 在端口 80 上运行良好(即,我的标准虚拟主机设置在 80 上侦听),所以一般的服务器设置似乎没问题。
还有什么我可以尝试的吗?
server {
listen 443 ssl;
server_name MY_DOMAIN.com;
ssl on;
ssl_certificate /etc/ssl/ssl-bundle.crt;
ssl_certificate_key /etc/ssl/MY_DOMAIN.key;
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
location / {
proxy_pass http://frontend;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
【问题讨论】: