Connection to Home Assistant OS failing with reverse proxy

I use my Synology NAS as a reverse proxy. It’s working fine for docker containers on the Synology itself, but it fails when trying to redirect to the Raspberry Pi running HOS. I get a white screen at first, then an error screen and I see it’s trying to connect to :5001 (Synology’s management UI port) rather than the correct port 8112. Synology support is no help, and Synology’s webstation app and QuickConnect is off, but neither helps. I cannot figure out why it keeps redirecting to 5001.

Config:

image
image