I am trying to deploy a web application on a tomcat server using Nginx. The problem I am facing is a tag on my jsp pages that displays the “wrong” (this is true from the point of view of tomcat) context path.
My tomcat web application is deployed in the context path: / webApp1 with tomcat running on port 8080. Thus, the web application is accessible via http: // localhost: 8080 / webApp1
My nginx is configured on proxy_pass as follows:
location / {
http://localhost:8080/webApp1;
}
In this configuration, the web application should work with the url http: // localhost
This only works for homepage text. The homepage loaded successfully, but all the links on the main page have / webApp 1, the prefix is like tomcat, they think that it works by itself, therefore it displays the context line as a prefix for all links.
Has anyone fixed this before.
All answers are greatly appreciated.
g.
source
share