Spring Security is redirecting to localhost on production server

前端 未结 4 1290
庸人自扰
庸人自扰 2021-01-18 15:45

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

4条回答
  •  感情败类
    2021-01-18 16:00

    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.

提交回复
热议问题