先上传证书到服务器
listen 80;
        listen 443 ssl http2;
        #listen [::]:80;
        # 证书路径
        ssl_certificate /root/.ssh/web/www.jiangpenghui.cn.pem;
        ssl_certificate_key /root/.ssh/web/www.jiangpenghui.cn.key;
        server_name www.jiangpenghui.cn jiangpenghui.cn;
        # http 转 https
        if ($server_port !~ 443){
            rewrite ^(.*)$ https://$host$1 permanent;
        }
        # jiangpenghu.cn转www.jiangpenghui.cn
        if ($host = 'jiangpenghui.cn') {
            return 301 https://www.jiangpenghui.cn$request_uri;
        }
..............省略