使用“让CloudFlare和nginx加密”时,525 SSL握手失败

时间:2017-01-13 19:19:55

标签: ssl nginx https cloudflare lets-encrypt

我很遗憾在尝试创建Let的加密SSL证书后尝试访问我的网站时,在cloudflare上出现525 SSL handshake failed错误。

我通过运行certbot-auto certonly然后输入我的电子邮件,域和webroot来生成证书。然后我将证书文件添加到我的服务器块,如下所示。

以下是相关的nginx服务器块:

server {
    listen 80;
    server_name mydomain.com www.mydomain.com;
    return 301 https://$host$request_uri;
}
server {
    listen 443 ssl;
    server_name mydomain.com www.mydomain.com;

    ssl_certificate         /etc/letsencrypt/live/mydomain.com/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/mydomain.com/privkey.pem;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-G$
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security max-age=15768000;

    root /var/www/html/mydomain.com;
    autoindex on;
    index index.php index.html index.htm;
    location ~ \.php$ {
            fastcgi_index index.php;
            fastcgi_pass 127.0.0.1:9000;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /.well-known {
            allow all;
    }
}

ls -l /etc/letsencrypt/live/mydomain.com的输出,如果重要的话:

total 4
-rw-r--r-- 1 root root 543 Jan 13 12:44 README
lrwxrwxrwx 1 root root  41 Jan 13 13:14 cert.pem -> ../../archive/mydomain.com/cert3.pem
lrwxrwxrwx 1 root root  42 Jan 13 13:14 chain.pem -> ../../archive/mydomain.com/chain3.pem
lrwxrwxrwx 1 root root  46 Jan 13 13:14 fullchain.pem -> ../../archive/mydomain.com/fullchain3.pem
lrwxrwxrwx 1 root root  44 Jan 13 13:14 privkey.pem -> ../../archive/mydomain.com/privkey3.pem

正在运行nginx -t不会出错。

我的CloudFlare设置:

SSL - 完整(严格)

0 个答案:

没有答案