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
在此之前,一切正常。任何人都知道有什么问题吗?