1

在生产中,我的 Grails 应用程序在 Tomcat 端口 8080 上运行,并位于 Apache 代理后面;端口 80。除身份验证外,所有功能均正常工作。当用户尝试登录应用程序时,Spring Security 会将 :8080 附加到目标 URL 并且连接超时,因为无法路由请求。

我已经在 config.groovy 中设置了以下内容,但没有成功:

    grails.serverURL = "http://domain.tld/${appName}"
grails.plugins.springsecurity.portMapper.httpPort = "80"
grails.plugins.springsecurity.portMapper.httpsPort = "443"

当我尝试使用内置身份验证或 OpenID 时会出现此问题。在我的托管服务提供商通过堵住一个洞并开始从外部阻止端口 8080 进行更改之前,该应用程序已经运行了 6 个多月。

我只需要 Spring Security 来编写没有 :8080 的 URL

任何帮助表示赞赏,谢谢!

更新 最后问题出在我使用的主机上。与 Apache ProxyPass 有关。相同的应用程序在新的生产 VPS 上运行良好。感谢您的输入。

4

3 回答 3

0

已在问题中回答

mod_rewrite 无法保护 grails 应用程序

tomcat 配置更改就像一个魅力。

于 2013-09-24T09:04:39.450 回答
0

我会考虑将tomcat更改为端口80并将所有apache请求转发到端口80。注意spring security使用x-forward proto头标签。

于 2013-09-08T16:34:11.317 回答
0

将以下内容添加到您的 Config.groovy 文件中:

grails.server.port.http = 80
于 2013-09-08T01:00:01.813 回答