站長資訊網
        最全最豐富的資訊網站

        centos7+nginx使用Certbot讓網站擁有https

        certbot官網

        1.獲取certbot-auto

          ####  下載  wget https://dl.eff.org/certbot-auto    ####  給予權限  chmod a+x ./certbot-auto

        2.使用

          #### 請改為自己的域名  ./certbot-auto --server https://acme-v02.api.letsencrypt.org/directory -d "*.xxx.com" -d "xxx.com" --manual --preferred-challenges dns-01 certonly    ####  出現如下 輸入郵箱  Enter email address (used for urgent renewal and security notices) (Enter 'c' to  cancel):     ####  輸入A同意  Please read the Terms of Service at  https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must  agree in order to register with the ACME server at  https://acme-v02.api.letsencrypt.org/directory  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  (A)gree/(C)ancel:     ####  輸入Y同意  Would you be willing to share your email address with the Electronic Frontier  Foundation, a founding partner of the Let's Encrypt project and the non-profit  organization that develops Certbot We'd like to send you email about our work  encrypting the web, EFF news, campaigns, and ways to support digital freedom.  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  (Y)es/(N)o:     ####  輸入Y確認  NOTE: The IP of this machine will be publicly logged as having requested this  certificate. If you're running certbot in manual mode on a machine that is not  your server, please ensure you're okay with that.    Are you OK with your IP being logged  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  (Y)es/(N)o:     ####  域名添加TXT解析  添加對應的域名和值 添加好后回車繼續  Please deploy a DNS TXT record under the name  xxxx.xxxx.com with the following value:    xxxxxxxx    Before continuing, verify the record is deployed.  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  Press Enter to Continue    ####  出現如下即成功  IMPORTANT NOTES:   - Congratulations! Your certificate and chain have been saved at:     /etc/letsencrypt/live/xxxxx.com/fullchain.pem     Your key file has been saved at:     /etc/letsencrypt/live/xxxxx.com/privkey.pem     Your cert will expire on 2018-12-28. To obtain a new or tweaked     version of this certificate in the future, simply run certbot-auto     again. To non-interactively renew *all* of your certificates, run     "certbot-auto renew"   - Your account credentials have been saved in your Certbot     configuration directory at /etc/letsencrypt. You should make a     secure backup of this folder now. This configuration directory will     also contain certificates and private keys obtained by Certbot so     making regular backups of this folder is ideal.   - If you like Certbot, please consider supporting our work by:       Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate     Donating to EFF:                    https://eff.org/donate-le

        3.nginx配置

          server {          listen   80;          listen 443 ssl spdy;          server_name xxx.xxx.com;          ssl on;          ssl_certificate /etc/letsencrypt/live/xxx.xxx.com/fullchain.pem;          ssl_certificate_key /etc/letsencrypt/live/xxx.xxx.com/privkey.pem;          ssl_session_cache shared:SSL:20m;          ssl_session_timeout  10m;          ssl_protocols TLSv1 TLSv1.1 TLSv1.2;          ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE:!kEDH;          ssl_prefer_server_ciphers on;          ssl_stapling on;          ssl_stapling_verify on;          ssl_trusted_certificate /etc/letsencrypt/live/xxx.xxx.com/chain.pem;           #啟用 HSTS 用于通知瀏覽器強制使用 https 通信          add_header Strict-Transport-Security "max-age=31536000";          resolver 8.8.8.8 8.8.4.4;                    #強制跳轉https          if ($scheme != 'https') {             return 301 https://$server_name$request_uri;          }                    ........     }
        贊(0)
        分享到: 更多 (0)
        網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
        主站蜘蛛池模板: 亚洲AV乱码久久精品蜜桃| 日韩人妻无码精品久久免费一| 亚洲av无码成人精品区| 国产精品网址你懂的| 亚洲欧洲久久久精品| 国产在线精品观看免费观看| 国产在线拍揄自揄视精品不卡| 四虎国产精品永久免费网址| 香蕉依依精品视频在线播放| 国产农村妇女毛片精品久久| 久久久精品午夜免费不卡| 经典国产乱子伦精品视频| 在线亚洲精品自拍| 精品国产高清在线拍| 99精品国产一区二区| 国产精品久久亚洲不卡动漫| 久久精品人人做人人爽电影蜜月| 欧美成人精品一区二区综合| 国产精品99久久久久久董美香| 国产精品你懂的| 国产精品无码无片在线观看| 亚洲国产精品无码久久久蜜芽| 欧美国产成人精品一区二区三区| 国产精品最新国产精品第十页 | 国产三级国产精品国产普男人| 99久久婷婷免费国产综合精品| 日产精品久久久久久久| 中文字幕日本精品一区二区三区| 三级国产精品| 日韩午夜高清福利片在线观看欧美亚洲精品suv | 2022精品天堂在线视频| 精品人伦一区二区三区潘金莲| 亚洲2022国产成人精品无码区| 亚洲精品宾馆在线精品酒店| 午夜精品久久久久9999高清| 亚洲av无码成人精品区| 在线精品无码字幕无码AV| 亚洲AV永久无码精品成人| 无码精品久久久久久人妻中字| 无码人妻精品一区二区三区东京热 | 国产精品一久久香蕉国产线看|