installing and running certbot successfully之后,我的网站显示以下错误消息:

此页面无效example.com重定向了您太多次 . 尝试清除您的cookie . ERR_TOO_MANY_REDIRECTS

我的 nginx 服务器配置( /etc/nginx/sites-available/myapp )如下所示:

server {

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    server_name www.example.com example.com;
    location / {
        proxy_pass http://127.0.0.1:8000;
    }

}

server {
    if ($host = www.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name www.example.com example.com;
    return 404; # managed by Certbot
}

/etc/letsencrypt/options-ssl-nginx.conf 的选项如下:

ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1440m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-$

如果我运行 curl -I http://example.com ,我得到这个:

HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.3 (Ubuntu)
Date: Mon, 10 Dec 2018 08:03:37 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: https://example.com/

如果我运行 curl -I https://example.com ,我得到这个:

HTTP/1.1 200 OK

但浏览器仍然显示我 This page isn’t working

在此之前一切正常 . 任何人都知道可能出现什么问题?