尝试使用Cloudflares新的免费通用SSL在Heroku上获得完全免费的SSL
阅读这篇文章:http: //mikecoutermarsh.com/adding-ssl-to-heroku-with-cloudflare/
这似乎表明Cloudflare现在可以免费提供SSL.
我采取的步骤:
用这个快速中间件强制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.com和https://example-app.com不起作用.浏览器选项卡图标一直在旋转,永远不会解析.关于如何使这个工作的任何想法?这甚至可能吗?
这看起来实际上是可能的.来自CloudFlare支持:
比尔,
从根本上说,只要"origin"支持SSL连接,您就可以使用Full SSL和CloudFlare.
西蒙
CloudFlare今天发布了这篇博文:https: //blog.cloudflare.com/universal-ssl-be-just-a-bit-more-patient/
我的网站已经开始解析,但是收到"您的连接不是私密"的消息,就像博客帖子中的"您可能看到的错误"部分一样.同样在我的CloudFlare设置中有一个"SSL发出"警报,所以我想一旦发布它可能只是工作.我会保留你们的帖子.