Grails redirect with reverse proxy

偶尔善良 提交于 2019-12-11 03:29:52

问题


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)

To: tomcat.company.local (for all java applications, including our grails app) lotus.company.local (for all Domino applications)

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.

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?

Thanks, Bram


回答1:


If you define grails.serverURL in Config.groovy, redirects with absolute:true will use that value for the URL.



来源:https://stackoverflow.com/questions/10798830/grails-redirect-with-reverse-proxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!