Mohammed90
(Mohammed Al Sahaf)
November 18, 2023, 11:38pm
6
This is where the 5-second latency is:
egbie:
Nov 18 22:52:38 fiducit-0-performance-server reverse-proxy_caddy[871925]: {"level":"debug","ts":1700344358.1787746,"logger":"http.handlers.reverse_proxy","msg":"waiting to read from upstream","upstream":"fiducit-0-performance-server:18002","duration":0.006043263,"request":{"remote_ip":"10.0.2.100","remote_port":"54232","client_ip":"10.0.2.100","proto":"HTTP/2.0","method":"GET","host":"wikicardia.de","uri":"/storage/base/titlelogo/3d6266fed52d0a99b6cebc1a209d1c33.png","headers":{"User-Agent":["curl/8.2.1"],"Accept":["*/*"],"X-Forwarded-For":["10.0.2.100"],"X-Forwarded-Proto":["https"],"X-Forwarded-Host":["wikicardia.de"]},"tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","server_name":"wikicardia.de"}}}
Nov 18 22:52:43 fiducit-0-performance-server reverse-proxy_caddy[871925]: {"level":"debug","ts":1700344363.278182,"logger":"http.handlers.reverse_proxy","msg":"read from upstream","upstream":"fiduci
This is the location in the code:
logger.Debug("waiting to read from upstream")
nr, rerr := src.Read(buf)
logger := logger.With(zap.Int("read", nr))
logger.Debug("read from upstream", zap.Error(rerr))
This points towards it not being an issue with Caddy. However, I have a hunch. Do you know if your upstream sets the Content-Length
header in its response off PNG files?
After you validate the fact about Content-Length
from your upstream app, can you try adding flush_interval -1
inside the reverse_proxy
block? Read about it here: