【技术种草】腾讯云上的Nginx安装SSL证书配置详细?

2021-11-30 19:58:14 浏览数 (1)

代码语言:javascript复制
nginx安装SSL证书配置详细
server {
    listen 443 ssl;
    server_tokens off;
    keepalive_timeout 5;
    root /usr/local/lighthouse/softwares/wordpress; #填写您的网站根目录,例如:/usr/local/lighthouse/softwares/wordpress
    index index.php index.html;
    access_log logs/wordpress.log;
    error_log logs/wordpress.error.log;
    server_name cloud.tencent.com; #填写您的证书绑定的域名,例如:www.cloud.tencent.com
    ssl_certificate 1_cloud.tencent.com_bundle.crt; #填写您的证书文件名称,例如:1_cloud.tencent.com_bundle.crt
    ssl_certificate_key 2_cloud.tencent.com.key; #填写您的私钥文件名称,例如:2_cloud.tencent.com.key
    ssl_session_timeout 5m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;  # 可参考此 SSL 协议进行配置
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;   #可按照此加密套件配置,写法遵循 openssl 标准
    ssl_prefer_server_ciphers on;
    location ~* .php$ {
        fastcgi_pass   127.0.0.1:9000;
        include fastcgi.conf;
        client_max_body_size 20m;
        fastcgi_connect_timeout 30s;
        fastcgi_send_timeout 30s;
        fastcgi_read_timeout 30s;
        fastcgi_intercept_errors on;
    }
}

0 人点赞