推薦使用包含自動化部署功能的Web服務(wù)器環(huán)境,如Nginx官方Docker鏡像配合Let’s Encrypt的certbot工具。需提前準(zhǔn)備:
通過certbot工具自動完成證書申請與驗證:
certbot certonly --standalone
生成證書/etc/letsencrypt/live/
使用Docker部署Nginx并掛載配置文件:
docker run -d -p 80:80 -p 443:443 \ -v /path/nginx.conf:/etc/nginx/nginx.conf \ -v /etc/letsencrypt:/etc/letsencrypt \ nginx:latest
配置文件中需包含SSL證書路徑聲明:
ssl_certificate /etc/letsencrypt/live/域名/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/域名/privkey.pem;
完成配置后執(zhí)行三項驗證:
curl -I https://域名
檢查證書狀態(tài)if ($scheme != "https") { return 301 https://$host$request_uri; }
2025-03-12
廣州蘇營貿(mào)易有限公司專注海外推廣十年,是谷歌推廣.Facebook廣告核心全球合作伙伴,我們精英化的技術(shù)團隊為企業(yè)提供谷歌海外推廣+外貿(mào)網(wǎng)站建設(shè)+網(wǎng)站維護運營+Google SEO優(yōu)化+社交營銷為您提供一站式海外營銷服務(wù)。
We and selected third parties use cookies or similar technologies for technical purposes and, with your consent, for other purposes as specified in the cookie policy.
You can consent to the use of such technologies by closing this notice, by interacting with any link or button outside of this notice or by continuing to browse otherwise.