解决LNMP使用Let's Encrypt证书更新不成功的问题

问题出现:

站点cloud.920.ai的是NextCloud,由于站点证书到期后没有自动续订成功,因此访问https://cloud.920.ai出现隐私设置错误的问题。

使用lnmp ssl add重新添加域名证书出现错误

cloud.920.ai:Verify error:Invalid response from http://cloud.920.ai/.well-known/acme-challenge/n2dwdsh7yNds5_jxnWkFApYLEwQW1tQW1wU4CXGOzHk

Please check log file for more details: /usr/local/acme.sh/acme.sh.log

问题解决:

编辑 /usr/local/nginx/conf/vhost/cloud.920.ai.conf文件,往server段加上下面代码,保存再重启nginx

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

如果重启nginx的过程中出现与下面类似的错误

Stoping nginx... nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/ssl/cloud.920.ai/fullchain.cer") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/ssl/cloud.920.ai/fullchain.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)

failed. Use force-quit

Terminating nginx... done

Starting nginx... nginx: [emerg] BIO_new_file("/usr/local/nginx/conf/ssl/cloud.920.ai/fullchain.cer") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/usr/local/nginx/conf/ssl/cloud.920.ai/fullchain.cer','r') error:2006D080:BIO routines:BIO_new_file:no such file)

failed

先把/usr/local/nginx/conf/vhost/cloud.920.ai.conf中与ssl相关的配置注释掉

然后再次执行lnmp ssl add

2019.05.18 10:53

添加新评论

๑òωó๑