0
votes

In Azure API Management, when request is passed on to the backend service, whats the best way of accessing original URL? For example the end user might request something like https://xxxx.azure-api.net/v1.4 Which is passed on to a backend service which could be hosted under https://example.com. End system needs to know the original Host client requested.

1
forward this with policy? - 4c74356b41
Tried that, meaning we'll have to configure UAT, dev etc separately. It's still a good option is there is nothing available. - xelber

1 Answers

2
votes

The most simple way to do that is indeed with policy:

<set-header name="X-Forwarded-Host" exists-action="override">
    <value>@(context.Request.OriginalUrl.ToUri().Host)</value>
</set-header>