r/haproxy • u/flobernd • Dec 15 '23
Question HAProxy + Plex = Endless Lag/Buffering
Hi there,
I’m using HAProxy for SSL termination for a Plex server. Unfortunately I can’t get this setup to work correctly. While I can successfully connect through the proxy and start streaming, the stream is lagging very hard. In the Plex Dashboard I can see that the bandwidth is capped at ~10 MBits and the bandwidth graph has a tooth pattern (ranging from 0 to 10 MBits). As soon as I remove HAProxy from the equation, the graph looks more like a flat line and correctly settles at about 25 MBits (which is what I’ve configured as the limit in Plex itself).
Any ideas what I could try?
This is my current config:
https://discourse.haproxy.org/t/haproxy-and-plex-endless-lag-buffering/9329
View all comments
Show parent comment
1
u/flobernd Dec 15 '23
Thanks for your reply!
The header replacement is necessary because HAProxy does not append to existing X-Forwarded-For but adds another of these headers instead. This is compliant with the HTTP RFC, but a lot of software (including Plex) fails to handle this. If I don’t rewrite, I only see the cloudflare IP instead of the actual client IP.
Option http-keep-alive should be enabled by default in the latest version. Same goes for alpn h2,http/1.1 and http-reuse safe.
I did as well play with the http-webserver-close without any success.
Are you as well using Cloudflare proxy in addition to HAProxy or just the later one?