首页 > 解决方案 > 您的连接不是私有的(nginx、bluehost、google cloud 和 cloudflare)

问题描述

我在 Debian 上使用 Nginx 在谷歌云的计算引擎中托管一个站点,我使用 Bluehost 域和 Cloudflare SSL。
我的网站有时有效,有时无效,并向我显示此消息:您的连接不是私人的。
解决办法是什么?

example.com 文件:

    服务器 {
    听 80;
    听 [::]:80;
    server_name example.com www.example.com;
    返回 302 https://$server_name$request_uri;
    }

    服务器 {

    #SSL 配置

    听 443 ssl http2;
    听 [::]:443 ssl http2;
    开启ssl;
    ssl_certificate /etc/ssl/certs/cert.pem;
    ssl_certificate_key /etc/ssl/private/key.pem;

    server_name example.com www.example.com;

    根 /var/www/example.com/html;
    索引 index.html index.htm index.php;
    ssl_client_certificate /etc/ssl/certs/cloudflare.crt;
    ssl_verify_client 开启;


    地点 / {
            try_files $uri $uri/ =404;
    }

    位置 ~ \.php$ {           
        包括片段/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    }
    }

标签: nginxdebianssl-certificategoogle-compute-enginecloudflare

解决方案


我认为 John H 搞定了,看来你有一个混合内容的问题。您可能最终不得不按照建议进行编辑,但我首先建议您尝试在“加密”选项卡上启用“自动 HTTPS 重写”。此处的其他混合内容建议,https://community.cloudflare.com/t/community-tip-fixing-mixed-content-errors/42476

如果您对 Cloudflare 有更多疑问,请访问 Cloudflare 社区,https: //community.cloudflare.com/t/community-tip-welcome-stackoverflow-visitors/99529 。”


推荐阅读