Thanks. That's the tomcat9 logformat string:
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %p %l %u %t "%r" %s %b" />
For haproxy I don't have a log-format string.
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
compression algo gzip
compression type text/html text/css text/plain text/vcard
text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy
application/atom+xml application/javascript application/x-javascript
application/json application/ld+json application/manifest+json
application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject
application/x-font-ttf application/x-web-app-manifest+json
application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml
image/x-icon text/cache-manifest
balance roundrobin
option dontlog-normal
option dontlognull
option httpclose
option forwardfor
> Am 18.11.2023 um 15:45 schrieb Willy Tarreau <[email protected]>:
>
> On Sat, Nov 18, 2023 at 03:20:51PM +0100, Christoph Kukulies wrote:
>> I would like to see more precisely what requests arrive at haproxy at which
>> port and how they are routed to the backend server (port).
>>
>> At the moment I don't see any connects in /var/log/haproxy/haproxy.log
>>
>> and at the backend server (tomcat9) I see the following (I extended the
>> logformat by the port #):
>>
>> 127.0.0.1 80 - - [18/Nov/2023:14:52:39 +0100] "GET / HTTP/1.1" 404 5679
>> 127.0.0.1 80 - - [18/Nov/2023:14:53:53 +0100] "GET /other/path HTTP/1.1" 200
>> 2584
>>
>> Wondering why I see port #80 rather than 8080 or 8082 according to my
>> haproxy.cfg:
>>
>>
>> backend website-static
>> server www.mydomain.org 127.0.0.1:8080
>>
>> backend website
>>
>> # http-request set-path /opencms%[path]
>> server www.mydomain.org 127.0.0.1:8080
>> backend cmssite
>>
>> # http-request set-path /opencms%[path]
>> server cms.mydomain.org 127.0.0.1:8082
>
> You didn't share the most important part, your log-format string!
> Everything is in it.
>
> Willy
>
smime.p7s
Description: S/MIME cryptographic signature

