On 05/02/2019 08:23, Johan Compagner wrote: > problem is that our customers are doing this. > also they can have 1 tomcat with a few webapps that they want to map under > different domains > > so that would mean for them starting 3 different tomcats under 3 different > ports and configure all that > thats not always something they want to do. > So i guess the only way for me is to have some kind of setting (per context)
They would be better configuring Tomcat with virtual hosts and having three ROOT webapps. Mark > > > On Mon, 4 Feb 2019 at 22:40, Christopher Schultz < > ch...@christopherschultz.net> wrote: > > Johan, > > On 2/4/19 07:09, Johan Compagner wrote: >>>> There are many older post for this on stackoverflow and so on >>>> https://stackoverflow.com/questions/10050550/why-does-getcontextpath-u > nder-a-proxy-return-the-internal-path-inside-httpserv > <https://stackoverflow.com/questions/10050550/why-does-getcontextpath-under-a-proxy-return-the-internal-path-inside-httpserv> >>>> >>>> but i wonder what the latest state of that is, we have a lot of >>>> proxy settings for host and scheme But is there something (a >>>> header) that a proxy can set so that Tomcat returns the right >>>> context path on that getContextPath() call? > > This is #49 on the list of "why you shouldn't be munging context paths > within a reverse-proxy". > >>>> Or are there headers that we have to check manually? >>>> >>>> If this is not the case then i guess the only way to fix this is to >>>> make it a configuration in our product something like >>>> >>>> String context = settings.getProperty("context.path", >>>> request.getContextPath()); >>>> >>>> (get the context from the settings if not there use the default >>>> value which is from the request) >>>> >>>> So the problem is mostly because of virtual hosts i guess >>>> >>>> where >>>> >>>> Proxy / is mapped to AppServer /Webapp1 > > How about "don't do that"? > > If you want to host your application on /, then host it on / and not > /Webapp1. > > -chris >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org