用旧的方法给 Laravel 项目安装 certbot https 证书报错:
sudo certbot --nginx Failed authorization procedure. xxx.abc.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://xxx.abc.com/.well-known/acme-challenge/xxx "<!DOCTYPE html>\n<html>\n <head>\n <meta name=\"robots\" content=\"noindex,nofollow\" />\n <style>\n /* Copyr"
从报错看,应该是要建立一个临时的目录文件,来验证网站归属。
Laravel 的资源跟目录是 public,所以指定参数之后,证书安装成功。
sudo certbot certonly --webroot -w /home/user_name/laravel_project_name/public -d xxx.abc.com Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator webroot, Installer None Obtaining a new certificate IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/xxx.abc.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/xxx.abc.com/privkey.pem Your cert will expire on 2019-12-06. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew"
再安装之前的方法将 nginx 的配置修改即可。