linux centos閰嶇疆Nginx鏀寔HTTPS璁块棶 Let鈥檚 Encrypt
git鐨勫畨瑁呭氨涓嶈浜 涓鑸潵璇磍inux鏈嶅姟鍣ㄩ兘鏈
git clone https://github.com/letsencrypt/letsencrypt 浣犳墍瑕佸畨瑁呯殑鐩綍
cd 浣犳墍瑕佸畨瑁呯殑鐩綍
#瀹夎涔嬪墠瑕佸厛鏀逛竴涓媙ginx鐨勯厤缃枃浠讹紝璁╃▼搴忓彲浠ヨ繘鍏ュ埌浣犵殑鐩綍搴曚笅
vi /usr/local/nginx/conf/nginx.conf
location ~ /.well-known {
allow all;
}
#閲嶅惎鏈嶅姟鍣
service nginx restart
# apache鐨勫懡浠ゅ簲璇ユ槸杩欎釜锛屾垜瀹夎鐨勬槸nginx
./letsencrypt-auto --apache -d example.com
#nginx
./certbot-auto certonly --webroot -w 浣犵殑缃戠珯鐩綍 -d liguoqi.site
#杩欎釜鏃跺欏簲璇ュ氨鎴愬姛浜嗭紝濡傛灉涓嶆垚鍔熺殑璇濓紝鍙兘鏄懡涓嶅ソ锛屼篃鍙兘鏄綘鐨勭綉绔欐牴鐩綍娌℃湁鏉冮檺
#鎴愬姛涔嬪悗浠栦細鍛婅瘔浣犵殑绉橀挜鍦ㄥ摢锛屽啀娆′慨鏀筺ginx閰嶇疆鏂囦欢锛屾坊鍔犱互涓嬩袱琛
ssl_certificate /etc/letsencrypt/live/liguoqi.site/fullchain.pem;
sl_certificate_key /etc/letsencrypt/live/liguoqi.site/privkey.pem;
# listen 80 鏀逛负 listen 443 ssl
# 澧炲姞浠ヤ笅鍑犲彞鍙互璁﹉ttp寮哄埗璺冲埌https
server {
listen 80;
server_name liguoqi.site;
return 301 https://$host$request_uri;
}
#鏈鍚庢坊鍔犱釜瀹氭椂浠诲姟 姣忓懆缁涓涓
crontab -e
30 3 * * 1 /opt/letsencrypt/certbot-auto renew --quiet --no-self-upgrade
35 3 * * 1 /etc/init.d/nginx reload
All posts
Other pages
Deprecated: 鏂囦欢 娌℃湁 comments.php 鐨勪富棰 鑷増鏈 3.0.0 璧峰凡寮冪敤锛屼笖娌℃湁鍙敤鐨勬浛浠c 璇峰湪鎮ㄧ殑涓婚涓寘鍚竴涓 comments.php 妯℃澘銆 in /www/wwwroot/liguoqi.site/wp-includes/functions.php on line 6078
鍙戣〃鍥炲