On 07/05/2019 13:37, André Warnier (tomcat) wrote: > Hi. > > On 26.04.2019 18:16, Mark Thomas wrote: >> On 24/04/2019 10:58, André Warnier (tomcat) wrote: >>> Hi. >>> >>> This is somewhat of an arcane question and somewhat straddling httpd and >>> tomcat, so if I'm on the wrong list for this, just let me know. >> >> Here is fine. We can always move the thread if necessary. >> >>> The question is : is there any particular reason why the combination >>> mod_proxy + mod_proxy_ajp (in httpd), does not seem to follow the >>> ProxyPreserveHost directive, when proxying something from httpd to >>> tomcat ? >> >> None that I am aware of. >> >> I've complete a quick test with httpd 2.4.34 and Tomcat 9.0.x and I see >> the host header is passed via AJP as expected. >> >> I suggest wireshark to look at what is on the wire. > > I haven't done a wireshark trace yet. > But as a cheap approximation for now, I tried to use the (tomcat) Access > Log to see what was going on, and there I hit another (but I believe > related) issue : > > According to : > http://tomcat.apache.org/tomcat-8.5-doc/config/valve.html#Access_Log_Valve > some patterns available are : > - %p - Local port on which this request was received. > and > - %{xxx}p write local (server) port (xxx==local) or remote (client) port > (xxx=remote) > > So if I understand this right, "%{local}p" should print the same as > "%p", and both should be "the local port on which this request was > received".
When using AJP the original values as received by httpd and passed by AJP are injected into the Tomcat request so things like redirects are generated correctly without additional configuration. It is one of those scenarios where things happen by "magic" which are great when it works bur can make debugging more complicated. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org