養鴨宗師
一個Coder的鬼島生存誌
2024-07-16
letsencrypt憑證更新後,但伺服器(nginx/apache/tomcat)不會autoreload
letsencrypt更新了憑證後,web server並不會知道憑證要重新讀取, 此時可利用letsencrypt的hooks機制,
以nginx為例,在以下路徑寫一個可執行的shell script:
/etc/letsencrypt/renewal-hooks/deploy/01-reload-nginx
============================
#! /bin/sh
set -e
nginx -t
systemctl reload nginx
============================
這樣每次renew憑證時,就會重新載入憑證了。
ref:
https://eff-certbot.readthedocs.io/en/stable/using.html#renewing-certificates
https://www.guyrutenberg.com/2017/01/01/lets-encrypt-reload-nginx-after-renewing-certificates/
https://www.javatpoint.com/starting-and-restarting-nginx
較新的文章
較舊的文章
首頁
訂閱:
文章 (Atom)