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

        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號
        主站蜘蛛池模板: 国内精品一级毛片免费看| 国产免费久久精品丫丫| 国产精品爽爽ⅴa在线观看| 精品日韩亚洲AV无码| 四虎影院国产精品| 成人免费精品网站在线观看影片| 国产AV午夜精品一区二区三区 | 国产精品99久久免费观看| 久久精品亚洲精品国产欧美| 88国产精品无码一区二区三区| 国产精品无码久久综合| 小辣椒福利视频精品导航| 蜜臀av无码人妻精品| 国产精品自在线拍国产手机版| 欧美高清在线精品一区| 97久久超碰成人精品网站| 精品一区二区三区在线观看视频| 亚洲精品tv久久久久| 欧美日韩精品系列一区二区三区国产一区二区精品 | 亚洲av日韩av天堂影片精品| 老年人精品视频在线| 国产精品一级毛片无码视频| 国产成人精品福利网站在线观看| 四虎永久在线精品国产免费| 久久国产精品久久精品国产| 国内精品久久久久久野外| 99热精品在线| 国产精品欧美日韩| 久久成人影院精品777| 亚洲第一精品福利| 99久久亚洲综合精品成人| 亚洲精品在线观看视频| 青青青国产精品国产精品久久久久| 99在线精品视频| 国产99视频精品一区| 久久99久久99小草精品免视看| 国内精品手机在线观看视频| 亚洲国产精品嫩草影院| 久久精品国产亚洲av水果派| 精品人妻少妇嫩草AV无码专区| 亚洲国产精品无码专区|