525 SSL handshake failed when using Let's Encrypt with CloudFlare and nginx
I am unfortunately getting a 525 SSL handshake failed
error on cloudflare when trying to access my site after trying to create a Let's Encrypt SSL Certificate.
I generated the certificate by running certbot-auto certonly
then entering my email, domain, and webroot. Then I added the certificate files to my server block as seen below.
Below is the relevant nginx server block:
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;
}
}
The output of ls -l /etc/letsencrypt/live/mydomain.com
if important:
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
Running nginx -t
gives no errors.
My CloudFlare settings:
SSL - Full (strict)
链接地址: http://www.djcxy.com/p/32476.html