美文网首页
nginx配置域名SSL

nginx配置域名SSL

作者: 清霆 | 来源:发表于2020-12-14 15:02 被阅读0次
  1. 通过 https://freessl.cn/ 获取crt、key文件。
  2. 打开 https://www.myssl.cn/tools/downloadchain.html
    复制粘贴crt文件内容并点击下一步,获取中间证书信息
  3. 将获取到的中间证书以及根证书内容复制粘贴到crt文件
  4. 配置nginx
server
{
    listen 80;
    listen 443 ssl;
    server_name ssl.com;
    index index.html;
    root /web/;

    ssl_certificate /usr/local/nginx/conf/conf.d/_ssh/ssl.crt;
    ssl_certificate_key /usr/local/nginx/conf/conf.d/_ssh/ssl.key;

    if ($scheme != https) {
        rewrite ^/(.*) https://$server_name/$1 permanent;
    }

    #location / {
        #try_files $uri $uri/ /index.html;
    #}

    #location /proxy-base/ {
        #proxy_pass http://127.0.0.1:8888/;
    #}

    location = /.well-known/pki-validation/fileauth.txt {
        default_type    text/plain;
        return 200 '2020121306';
    }
}

相关文章

网友评论

      本文标题:nginx配置域名SSL

      本文链接:https://www.haomeiwen.com/subject/acmvgktx.html