Search code examples
tomcatglassfishhostname

Map my web app context path to hostname in Glassfish or Tomcat


Is it possible to map a web application running on Glassfish with context="MyApp1" to www.myFirstApp.com for example and another web app in the same domain with another context path to another hostname (www.mySecondApp.com)?

Examples

http://127.0.0.1:8080/MyApp1/  >> To >>  http://www.myFirstApp.com
http://127.0.0.1:8080/MyApp2/  >> To >>  http://www.mySecondApp.com

I want to bypass web app context path on my deploy-server.


Solution

  • You'll want to use a virtual server. The documentation will be useful and here's a blog that explains it further. Keep in mind the blog is a bit outdated but the concepts are the same.