discuz更新https证书

上篇说到了需要迁移下服务器,

看了下 https 证书也快过期了,

就顺便也一起更新了一下。

  • 先去 https://freessl.cn 申请了一张免费证书:操作一波、证书下来后,将证书上传到服务器上。
  • 然后调整服务相关配置代码
server
    {
        listen 80;
        server_name  798wd.com www.798wd.com;
        rewrite ^(.*)$  https://$host$1   permanent;
    }

server
    {
        listen 443;
        server_name  798wd.com www.798wd.com;
        ssl_certificate /data/ssl/wd798.www.com/full_chain.pem;
        ssl_certificate_key /data/ssl/wd798.www.com/private.key;

        root  /data/web/upload;
        index index.html index.htm index.php default.html default.php;
        include /data/conf/rewrite/wd798/798wd.com.rewrite;

        ssl_session_timeout 5m;
        ssl_prefer_server_ciphers on;
        ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;


        access_log  /data/wwwlogs/wd798-com-access.log main;
        error_log /data/wwwlogs/wd798-com-error.log;

  
        error_page 403  400 404 /404.html;
        location = /404.html {
            #放错误页面的目录路径。
            root /data/web;
        }

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }


        location = /favicon.ico {
            log_not_found off; access_log off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

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

        location ~ /\.
        {
            deny all;
        }

    }

  • nginx -t 检查是否存在配置错误
  • nginx -s reload 重启服务

本文为阿远原创文章,转载无需和我联系,但请注明来自阿远博客 https://www.xianhenyuan.com

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值