-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 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 > > 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 -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlxYsWIACgkQHPApP6U8 pFhOeA//SmTil/dDz1ewySksqKiI83WjEtkrJ7/1xcaISkrU+t42bMOx8sLS/SOh VX2O/c0hlLuDy5YfaBClZgd7qLHmy3a5xcLpazUtw9CFZuJD+UTahxlK2AwysOzd +ns0qlRJEOZrxAxCfJpJ6yUZ9DppbKSHd8fd+XopIiRQyqJ3pWJtCZ61B3zJC7Ln Vxo7Qpk/1qQht8XhgRdkh1EOB+sJRziowcchu/t0xtpQNVH47czwVC4LpyX9wp43 jMhlfVfwqjNAtgNsvm8YE3zfr8DUw3Q7hxwRk5EzGrRbq8R++++AoDEFri8F/9RB zhI+8tPi73JxYaz8/8MzIxGY2A0La6A2P/qCNjNYAoXy0tlzsN0MgUIvXjgnaRJl bRWwFlpqrOPqRkS7PvBa98rFiXzbC/Ef6uE68hTK7XrV/Ki9Pm4uJ+hbSdurHz7c KkKwgMmcpJ6nc80lOaXxtviuXbTrcxY1rGivhRiHr1nemRZkxwMzybf0nynhMtaa nuGFdKC/KGk25FM6xZEVzUuYLX7NV57GWPZcFkmcvfd87gRLwdmti+5vVGMIvC8z HYMDd4ArfkY3JYOeIlVc76mpTfCWPcFfN6U30G+dVwFEYUqGxOtRM6QY2OFbtpMW Ah8/FKULkBMCoD2AV0JJvTXz9PZ/v0bYPaitKRrPQZrlyp1CJ5M= =uP57 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org