耿俭

typecho开启阿里云cdn加速 https无法进入后台解决方法
最近网站启用了阿里云cdn加速,但是开启https后网站后台打不开,输入账号密码后直接导致空白,下面给大家分享一下...
扫描右侧二维码阅读全文
29
2019/06

typecho开启阿里云cdn加速 https无法进入后台解决方法

最近网站启用了阿里云cdn加速,但是开启https后网站后台打不开,输入账号密码后直接导致空白,下面给大家分享一下解决方法。

首先阿里云要开启全站加速,HTTPS设置,开启https,使用免费证书或者自定义上传证书。
阿里云cdn加速跟随设置.png

动静态加速规则>动态加速>协议跟随回源>跟随。
阿里云cdn加速跟随设置.png

配置服务器301跳转,http跳转到https

server
    {
        listen 80;
        #listen [::]:80;
        server_name gengjian.net www.gengjian.net;
        return 301 https://www.gengjian.net$request_uri;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/gengjian.net;

        include rewrite/wordpress.conf;
        #error_page   404   /404.html;

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

        include enable-php.conf;

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

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

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

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }

server
    {
        listen 443 ssl http2;
        #listen [::]:443 ssl http2;
        server_name www.gengjian.net;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/gengjian.net;
        ssl on;
        ssl_certificate /usr/local/nginx/conf/ssl/gengjian.net/fullchain.cer;
        ssl_certificate_key /usr/local/nginx/conf/ssl/gengjian.net/gengjian.net.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
        ssl_session_cache builtin:1000 shared:SSL:10m;
        # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
        ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

        include rewrite/wordpress.conf;
        #error_page   404   /404.html;

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

        include enable-php.conf;

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

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

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

        location ~ /\.
        {
            deny all;
        }

        access_log off;
    }

server
    {
        listen 443 ssl http2;
        #listen [::]:443 ssl http2;
        server_name gengjian.net;
        return 301 https://www.gengjian.net$request_uri;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/gengjian.net;
        ssl on;
        ssl_certificate /usr/local/nginx/conf/ssl/gengjian.net/fullchain.cer;
        ssl_certificate_key /usr/local/nginx/conf/ssl/gengjian.net/gengjian.net.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
        ssl_session_cache builtin:1000 shared:SSL:10m;
        # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
        ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

    }
最后修改:2019 年 06 月 29 日 08 : 51 AM

发表评论 取消回复