【问题标题】:Grails application on Heroku with ssl使用 ssl 在 Heroku 上的 Grails 应用程序
【发布时间】:2012-04-13 08:42:07
【问题描述】:

我在 jetty runner 上的 Heroku 上部署了一个 grails 应用程序。

我从 dnsSimple 购买了 SSL 证书并成功配置它,考虑到当我点击“https://mydomainname.com”时我可以看到证书信息。

现在我想强制在 https 上进行所有通信。
我尝试了以下方法,但到目前为止没有任何效果:
grails - simple App to test spring-security-core secure-channel on Heroku
grails - spring-security-core secure-channel causing redirect loop (on Heroku)
还有很多其他帖子建议使用 https 过滤器,但没有运气。
你能帮帮我吗?

【问题讨论】:

标签: grails heroku


【解决方案1】:

请参阅 Heroku 插件文档中的“使用 Spring Security Core 插件”部分,其中讨论了 useHeaderCheckChannelSecurity 属性:http://grails-plugins.github.com/grails-heroku/docs/manual/guide/2%20Usage.html

【讨论】:

  • 感谢您的回复伯特。我已经完成了插件文档中定义的所有事情,并且我的应用程序在 heroku 上成功运行。当我在地址栏中输入带有 https 前缀的 domain.com 时,它会在 https 上提供服务,但是当我输入 domain.com 时,它不会重定向到 https 。你能告诉我如何强制应用程序在 https 上重定向它..
  • @Amit 你有没有让这个工作?我在 Amazon Elastic beanstalk 上玩这个(也在 Heroku 上试过),但无法通过重定向问题。
【解决方案2】:

这个问题似乎是由于 spring 安全核心中使用的“'x-forwarded-proto”标头和 heroku 负载均衡器用于基于 https 的 url 的“X-FORWARDED-PROTO”标头的错误案例。以下链接对我有用。
Heroku Forum

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-15
    • 2021-01-03
    • 1970-01-01
    • 2019-06-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多