I like caddy for flexibility and ease with handle_parh. I believe there was some example on the tailscale website for a tcp caddy proxy.
Some sites cant be rewritten and have to be served on their expected path. Like some http file will refer to a css or something with absolute path.
Also you can get chatgpt or similar help you and ask it to explain whats being done and why. Just be stern and let it know what you’re using for software + versions. They know a lot of old shit too these LLMs
Perhaps you can rewrite but that would have to include both ways + html source.
Best bet is serve at what path it prefers or can be configured to