Grails使用反向代理进行重定向 [英] Grails redirect with reverse proxy
问题描述
我们开发了一个使用重定向的Grails应用程序。
由于外部原因,我们刚刚使用反向代理,将一些流量分割为域:
来自:
demo1.company.local(服务器本身)
We've developed a Grails application that uses redirects. Beacuse of external reasons, we are just recently using reverse-proxy, to split some traffic to domains: From: demo1.company.local (the server itself)
到:
tomcat.company.local(适用于所有Java应用程序,包括我们的grails应用程序)
lotus.company.local(适用于所有Domino应用程序)
To: tomcat.company.local (for all java applications, including our grails app) lotus.company.local (for all Domino applications)
由于tomcat只在demo1服务器的主机文件中配置,所以当我从其他地方访问应用程序时,重定向不起作用,然后从demo1服务器本身访问。
Since tomcat is only configured in the hosts file on the demo1 server, the redirects do not work when I access the application from anywhere else then the demo1 server itself.
我试图在Grails的redirect()中使用绝对和/或base参数来解决这个问题,但是如果我理解正确,那么这只是Grails 2+,重新使用Grails 1.3.4。
I've tried to solve this using "absolute" and/or "base" parameter in Grails' redirect(), but if I understand correctly, this is Grails 2+ only and we're using Grails 1.3.4.
是否有其他方法可以重定向到指定的主机?
我滥用了什么?
Are there other ways to redirect to a specified host? Am I misusing things?
谢谢,
Bram
Thanks, Bram
推荐答案
如果您在Config.groovy中定义 grails.serverURL
,则使用 absolute:true
重定向将使用该值的URL。
If you define grails.serverURL
in Config.groovy, redirects with absolute:true
will use that value for the URL.
这篇关于Grails使用反向代理进行重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!