主要有三件:
後來重新申請 : longfutemple.duckdns.org
rich@rich-vb-u24:~/pure-php-app$ sudo certbot certonly --webroot -w /home/rich/pure-php-app/wordpress-data-longfu -d longfutemple.duckdns.com -v
[sudo] rich 的密碼:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Requesting a certificate for longfutemple.duckdns.com
Performing the following challenges:
http-01 challenge for longfutemple.duckdns.com
Using the webroot path /home/rich/pure-php-app/wordpress-data-longfu for all unmatched domains.
Waiting for verification...
Challenge failed for domain longfutemple.duckdns.com
http-01 challenge for longfutemple.duckdns.com
Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
Domain: longfutemple.duckdns.com
Type: unauthorized
Detail: 34.160.121.137: Invalid response from <http://ww547.duckdns.com>: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\"/>\n <meta name=\"viewport\" content=\"width=device-width,initia"
Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed domains serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
Cleaning up challenges
Some challenges have failed.
Ask for help or search for solutions at <https://community.letsencrypt.org>. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
rich@rich-vb-u24:~/pure-php-app$
您的 Certbot 憑證申請失敗,最關鍵的錯誤藏在錯誤訊息的這行字裡:Detail: 34.160.121.137: Invalid response from <http://ww547.duckdns.com>: ...
這裡有兩個嚴重的問題導致 Let's Encrypt 驗證失敗:
ww547.duckdns.com(最致命)您明明申請的是 longfutemple.duckdns.com,但 Let's Encrypt 嘗試連線時,卻被重導向(Redirect) 到了一個奇怪的網址 ww547.duckdns.com。
您在主機下指令:-w /home/rich/pure-php-app/wordpress-data-longfu
.well-known/acme-challenge/ 的驗證檔案。http://duckdns.com。此時負責接電話的是 Nginx 容器。如果您的 Nginx 容器內部,沒有把 root 指向到對應的這個資料夾,Nginx 就抓不到檔案,進而回報錯誤。既然您使用的是 DuckDNS,最建議的做法是直接改用 DNS 驗證(--manual --preferred-challenges dns)。這個方法完全不需要理會 Nginx 的網頁路徑,只要您去 DuckDNS 後台手動加一筆紀錄,就能直接拿到憑證。