Heroku + Cloudflare 完全免费的 SSL [英] Heroku + Cloudflare completely free SSL
问题描述
尝试使用 Cloudflares 新的免费 Universal SSL
Attempting to get completely free SSL on Heroku using Cloudflares new free Universal SSL
阅读这篇文章:http://mikecoutermarsh.com/adding-ssl-to-heroku-with-cloudflare/
这似乎表明 Cloudflare 现在可以免费提供 SSL.
Which seems to suggest its possible now that Cloudflare offers SSL for free.
我采取的步骤:
- 使用 Cloudflare 设置我的 DNS(免费帐户)
- 将我的域转发到我的 herokuapp (CNAME example-app.com -> example-app.herokuapp.com)
- 将 Cloudflare SSL 选项设置为完整 SSL"
- 将我的域添加到我的 heroku 应用程序
使用这个 express 中间件强制使用 https:
- 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();
}
});
heroku 域 http://example-app.herokuapp.com 工作正常并重定向到 https://example-app.herokuapp.com,绿锁等等.
The heroku domain http://example-app.herokuapp.com works correctly and redirects to https://example-app.herokuapp.com, green lock and all.
http://example-app.com 和 https://example-app.com 不起作用.浏览器标签图标一直在旋转,永远不会解决.关于如何让这个工作的任何想法?这甚至可能吗?
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?
这看起来确实是可能的.来自 CloudFlare 支持:
This is looking like it IS actually possible. From CloudFlare support:
比尔,
从根本上说,只要源"支持 SSL 连接,您就可以将 Full SSL 与 CloudFlare 结合使用.
Fundamentally, as long as the "origin" supports an SSL connection you can use Full SSL with CloudFlare.
西蒙
CloudFlare 今天发布了这篇博文:https://blog.cloudflare.com/universal-ssl-be-just-多一点耐心/
CloudFlare released this blog post today: https://blog.cloudflare.com/universal-ssl-be-just-a-bit-more-patient/
我的网站已开始解析,但收到您的连接不是私人的"消息,如博客文章的您可能会看到的错误"部分.同样在我的 CloudFlare 设置中有一个SSL 发布"警报,所以我想一旦它被发布,这可能会起作用.我会及时通知你们.
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.
推荐答案
这与我设置的完全一样.问题是 CloudFlare 花了几天时间才发布他们的 无限 SSL.一旦它在您的 CloudFlare SSL 设置下显示SSL active",它就会起作用.
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屋!