Per server rewriting

Here’s my case:
I got 2 HTTP endpoints, example.com/hello and example1.com/prod/hello.
I’d like company.com/hello to be load balanced between example.com and example1.com, but their paths differ.

company.com/hello -> example.com/hello
company.com/hello -> example1.com/prod/hello

I came across this question on ServerFault but it’s quite old by now.
How can I do this with HAProxy? Is there a way to rewrite the URI on a per server basis?