Heroku + Cloudflare完全免费的SSL [英] Heroku + Cloudflare completely free SSL
问题描述
尝试使用Cloudflares在Heroku上获得完全免费的SSL新的免费通用SSL
阅读这篇文章:
http:// mikecoutermarsh。 com / added-ssl-to-heroku-with-cloudflare /
这似乎暗示了Cloudflare可以免费提供SSL。 >
我采取的步骤:
- 使用Cloudflare(免费帐户)设置我的DNS
- 将我的域转发到我的herokuapp(CNAME example-app.com - > example-app.herokuapp.com)
- 将Cloudflare SSL选项设置为全SSL
- 将我的域名添加到我的英雄应用程序
-
强制使用此快速中间件https:
app.use(function(req,res,next){
if(req.headers ['x -forward-proto']!= 'https'){
res.redirect('https://'+ re q.headers.host + req.path);
}
else {
return next();
}
});
英雄网域 http://example-app.herokuapp.com 正常运行,并重定向到 https://example-app.herokuapp.com ,绿色锁定和全部。
http://example-app.com 和 https://example-app.com 无效。浏览器标签图标不断旋转,永远不会解决。关于如何使这项工作有任何想法?这是可能的吗?
*更新
这看起来真的是可能的。从CloudFlare支持:
您好,Bill,
从根本上说,只要origin支持SSL连接,您可以使用全面SSL与CloudFlare。
Simon
CloudFlare今天发布了这篇博文:
https: //blog.cloudflare.com/universal-ssl-be-just-a-bit-more-patient/
我的网站已经开始解决了,但是得到一个你的连接不是私人的消息,如你可能会看到的错误部分的博文。另外在我的CloudFlare设置中有一个SSL发出警报,所以我想象一旦发布,这可能只是工作。我会保持y'all发布。
这样做与我设置的一样。问题是,CloudFlare花了几天的时间发布他们的无限制SSL 。一旦它在CloudFlare SSL设置下显示SSL活动,它将会起作用。
Attempting to get completely free SSL on Heroku using Cloudflares new free Universal SSL
Read this article: http://mikecoutermarsh.com/adding-ssl-to-heroku-with-cloudflare/
Which seems to suggest its possible now that Cloudflare offers SSL for free.
The steps I took:
- Set up my DNS with Cloudflare (free account)
- Forwarded my domain to my herokuapp (CNAME example-app.com -> example-app.herokuapp.com)
- Set the Cloudflare SSL option to 'Full SSL'
- Added my domain to my heroku app
Forcing https with this express middleware:
app.use(function(req, res, next) { if (req.headers['x-forwarded-proto'] != 'https') { res.redirect('https://' + req.headers.host + req.path); } else { return next(); } });
The heroku domain http://example-app.herokuapp.com works correctly and redirects to https://example-app.herokuapp.com, green lock and all.
Both http://example-app.com and https://example-app.com do not work. The browser tab icon just keeps spinning and never resolves. Any ideas on how to get this working? Is this even possible?
*UPDATE
This is looking like it IS actually possible. From CloudFlare support:
Hi Bill,
Fundamentally, as long as the "origin" supports an SSL connection you can use Full SSL with CloudFlare.
Simon
CloudFlare released this blog post today: https://blog.cloudflare.com/universal-ssl-be-just-a-bit-more-patient/
My site has started resolving, but getting a "Your connection is not private" message like in the "Errors you may see" part of the blog post. Also in my CloudFlare settings there is a "SSL issuing" alert, so I imagine once it is issued this may just work. I'll keep y'all posted.
This does work exactly as I had it set up. The problem was that it took a couple days for CloudFlare to issue their Unlimited SSL. Once it says 'SSL active' under your CloudFlare SSL settings, it will work.
这篇关于Heroku + Cloudflare完全免费的SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!