That unix domain socket solution sounds really nice. I wonder if it would be possible to send something naughty in the host header (like something with ../../.. in it) to misuse this or nginx does some validation before it reaches the proxy_pass...
I also tried to hack together my own solution [0] just for fun, but I didn't know about the unix socket part, so at the end I went with traefik and redis. :)
[0] https://deadlime.hu/en/2023/10/29/light-at-the-end-of-the-tu...