相关疑难解决方法(0)

Heroku + Cloudflare完全免费的SSL

尝试使用Cloudflares新的免费通用SSL在Heroku上获得完全免费的SSL

阅读这篇文章:http: //mikecoutermarsh.com/adding-ssl-to-heroku-with-cloudflare/

这似乎表明Cloudflare现在可以免费提供SSL.

我采取的步骤:

  • 使用Cloudflare设置我的DNS(免费帐户)
  • 转发我的域名到我的herokuapp(CNAME example-app.com - > example-app.herokuapp.com)
  • 将Cloudflare SSL选项设置为"完整SSL"
  • 将我的域名添加到我的heroku应用程序中
  • 用这个快速中间件强制https:

    app.use(function(req, res, next) {
        if (req.headers['x-forwarded-proto'] != 'https') {
            res.redirect('https://' + req.headers.host + req.path);
        }
        else {
            return next();
        }
    });
    
    Run Code Online (Sandbox Code Playgroud)

heroku域http://example-app.herokuapp.com正常工作,并重定向到https://example-app.herokuapp.com,绿锁和所有.

无论http://example-app.comhttps://example-app.com不起作用.浏览器选项卡图标一直在旋转,永远不会解析.关于如何使这个工作的任何想法?这甚至可能吗?

*更新

这看起来实际上是可能的.来自CloudFlare支持:

比尔,

从根本上说,只要"origin"支持SSL连接,您就可以使用Full SSL和CloudFlare.

西蒙

CloudFlare今天发布了这篇博文:https: //blog.cloudflare.com/universal-ssl-be-just-a-bit-more-patient/

我的网站已经开始解析,但是收到"您的连接不是私密"的消息,就像博客帖子中的"您可能看到的错误"部分一样.同样在我的CloudFlare设置中有一个"SSL发出"警报,所以我想一旦发布它可能只是工作.我会保留你们的帖子.

ssl heroku node.js express cloudflare

20
推荐指数
2
解决办法
9725
查看次数

标签 统计

cloudflare ×1

express ×1

heroku ×1

node.js ×1

ssl ×1