Home grails.serverURL with Nginx doesn't work properly
Reply: 1

grails.serverURL with Nginx doesn't work properly

sullivan Published in 2013-08-03 09:54:28Z

I have my Grails 2.1 Application running within a Tomcat 7.x container. It's called ROOT.war. Nginx takes care for routing. Both components are on their own Ubuntu 12.4 servers.

The grails.serverURL in Config.groovy is set to the prod Domain www.myproddomain.com. So far, everything works perfect.

If I now want to test the Grails App before I activate the tomcat in Nginx, so I tried to use the internal URL from the server such as internalipofserver:8080. This works, but since the grails.serverURL is set to www.myproddomain.com, I cannot click around without beeing redirected to www.myproddomain.com which makes no sense to test then.

If I now leave grails.serverURL away, the preview on internalipofserver:8080 works fine, but as soon as I activate this tomcat in nginx to be reachable under www.myproddomain.com, certain resources will be pulled from internaliofserver:8080.

It seems to me as of tomcat would kind of store the first address that the site was called and then use that url.

Can you advise? Thank you. Best Sullivan

Chris Reply to 2013-08-06 22:52:19Z

grails.serverURL does not have anything to do with the outside url (except for absolute links generated from grails). You can configure your nginx to handle any domain and internally do the proper redirects.

The caching you have described is probably due to the browser cache.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.323938 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO