I have a grails application with the spring-security-core plugin installed. Everything works fine locally. I deployed to a staging server and everything worked fine. I de
I know this is an old question, but I would like to add my findings to help other users that might encounter this problem.
In addition to Burt's answer (I'm assuming that you are using tomcat), I found out that the returned value of request.getServerName() can also be set via server.xml
i.e in tomcat 8 https://tomcat.apache.org/tomcat-8.0-doc/config/http.html
having this line in server.xml
would return "localhost" when getServername is invoked.