2

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

BramP
  • 51
  • 6
  • I remember using absolute urls in Grails 1.3. Should be working. What do you have as a result? Exception? invalid url? relative url? – Igor Artamonov May 29 '12 at 13:26

1 Answers1

1

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

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • Thanks for the quick response. I've noticed that parameter in the documentation: http://grails.org/doc/latest/ref/Controllers/redirect.html but I understand this is Grails 2+ functionality, is that correct? We're using 1.3.4 and based on our Grails 2+ experiences (auto-building in Jenkins using Maven), we don't think we're / Maven-Grails is ready for that upgrade. Do you know any solution icw. Grails 1.3.4? Thanks – BramP May 29 '12 at 14:09
  • @user1423609 No, grails.serverURL exists for grails 1.x as well. – Ingo Kegel May 29 '12 at 15:00