前些时间服务器配置了ipv6拜访,起初就收到了let’s encrypt的邮件说域名ssl证书过期。但问题是certbot会应该是自动更新证书才对啊。

登上服务器手动更新证书试下,提醒404谬误:

IMPORTANT NOTES: - The following errors were reported by the server:   Domain: gwlin.com   Type:   unauthorized   Detail: Invalid response from   http://gwlin.com/.well-known/acme-challenge/eHOBoFPw4Uz5vM9Xzk9D91nsm292bxSNyuePVerQRMY   [2600:3c01::f03c:92ff:fee2:491b]: "<html>rn<head><title>404 Not   Found</title></head>rn<body bgcolor="white">rn<center><h1>404   Not Found</h1></center>rn<hr><center>"   To fix these errors, please make sure that your domain name was   entered correctly and the DNS A/AAAA record(s) for that domain   contain(s) the right IP address. 

于是谷歌一顿,但文章都在说是well-known目录的配置问题,于是查看了nginx配置,查看了网站根目录的权限,齐全没用。

在stackoverflow上有一个0赞的答案说到应该查看ipv6是否开启了,如果开启了就要加上 [::]:80 。

一言惊醒梦中人啊,忽然想起前端工夫的确启用了ipv6。于是关上gwlin.com的nginx配置文件,加上:

{  //...  server_name gwlin.com;  listen 80;  listen [::]:80; // 加这个  //...}

而后certbot更新证书,搞定。

参考文章:

https://stackoverflow.com/questions/42269107/using-certbot-to-apply-lets-encrypt-certificate-failed-authorization-procedure

集体博客:https://www.gwlin.com/posts/5942