Set-uri return error 503

Hi,

I want to display for my users data from a whole different URL, not by redirecting them to there but just to display the data.

For that, I am trying to use
http-request set-uri https://images.domain.com%[path]?%[query]
but I keep getting error 503 - Service Unavailable.

I know that the rest of the code works because when I use
http-request redirect location https://images.domain.com%[path]?%[query]
it works.

Why does the
http-request set-uri https://images.domain.com%[path]?%[query]
fails?

Thank you!

It rewrites a request. That doesn’t suddenly transform haproxy into a forward proxy and spawns a http request towards some other location.

Use the errorfile directive for custom error files (generated by haproxy) or http-response return to rewrite backend generated responses.

Thank you for the quick reply!
Do you have an example of how I can achieve what I described above: how can I make a request to a whole different URL, get the response and send it back?
Thank you!

There isn’t, as explained above.