Search code examples
javatomcatspring-securityvirtualspring-roo

How to change application root in a virtual url


From my university I got an virtual server, where I have my Tomcat installed. This instance is only reachable from within the local network, so the IT Admin also got me an forward URL to connect to tomcat from the outside. I deployed my Spring Roo project as a WAR file and I can see my index.jsp site.

Now I have the following problem: From the outside I reach my project via the forward URL from www.example.com/someDirectory/VM/8080/projectName/ But spring_security refers to the root directory, so when I want to login I'm going to www.example.com/spring_security Same thing for the generated links, the also refer to www.example.com/link

How can I fix this?


Solution

  • The short answer is that you can't (easily) without some help from your IT Admin.

    You need to know how they are reverse proxying the public URL to your Tomcat instance and then you are almost certainly going to need to ask them to make some changes. What those changes are will depend on how things are currently configured. You might also need to change the context path your application is deployed on to make the changes to the reverse proxy simpler.