久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

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

      nginx如何防止ssl證書過期

      nginx如何防止ssl證書過期

      nginx如何防止ssl證書過期?

      nginx配置免費SSL證書及證書定時更新

      環(huán)境 contos 6,證書發(fā)行Let's Encrypt

      證書生成前提是域名是可用的,即已經備案通過并且有DNS解析到了具體IP

      1、安裝epel,

      >yum install epel-release

      2、下載certbot證書生成工具certbot-auto

      >wget https://dl.eff.org/certbot-auto --no-check-certificate

      3、安裝工具的依賴

      >chmod +x certbot-auto >./certbot-auto -n

      4、生成證書

      單域名:

      >./certbot-auto certonly --email my@163.com --agree-tos --no-eff-email --webroot -w /usr/local/nginx/html/xue/ -d www.xue37.cn

      注意:替換郵箱、網站目錄和域名

      多域名:

      >./certbot-auto certonly --email my@163.com --agree-tos --no-eff-email --webroot -w /usr/local/nginx/html/xue/ -d www.xue37.cn -d xue37.cn

      證書生成在/etc/letsencrypt/live/www.xue37.cn/目錄下(具體生成地址執(zhí)行完命令有提示信息)

      5、證書延期(因為證書有效期為90天)

      certbot-auto工具支持證書延期操作,因此可以使用crontab定時任務定時自動延期

      >0 3 * * * /root/certbot-auto renew --disable-hook-validation --renew-hook "/usr/local/nginx/sbin/nginx -s reload"

      每天3點進行證書延期,crontab表達式自己可以百度

      注意:

      自己可以先單獨執(zhí)行一下:

      /root/certbot-auto renew --disable-hook-validation --renew-hook "/usr/local/nginx/sbin/nginx -s reload"

      我這里提示The following certs are not due for renewal yet,表示證書未到期,沒有其他錯誤。因此為了防止證書失效時間過久,這里可以設置為每天都進行延期操作

      6、nginx增加證書配置

      server { listen 443 ssl; server_name www.xue37.cn;     ##這里是你的域名 ssl_certificate /etc/letsencrypt/live/www.xue37.cn/fullchain.pem;    #前面生成的證書,改一下里面的域名就行 ssl_certificate_key /etc/letsencrypt/live/www.xue37.cn/privkey.pem;   #前面生成的密鑰,改一下里面的域名就行 ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; access_log /data/application/logs/xue.access.log main; location ^~ /bot { proxy_pass http://xue-server; include proxy-params.conf; } location / { root html/xue; index index.html index.htm; } location = /50x.html { root html; } }

      7、設置80端口301到443

      修改nginx配置:

      server { listen 80; server_name localhost; location /.well-known/ { add_header Content-Type 'text/plain;'; root /usr/local/nginx/html/xue; } location / { return 301 https://www.xue37.cn$request_uri; } }

      注意:nginx修改后需要重啟:/usr/local/nginx/sbin/nginx -s reload

      注意:nginx配置需要處理

      location ~ /. { deny all; }

      這段配置刪掉或注釋掉或在這段配置前面加上(如果沒有這段配置請忽略)

      location ~ /.well-known { allow all; }

      贊(0)
      分享到: 更多 (0)
      網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號