A simple, simple proxy redirect to our www subdomain is resulting in the query string being stripped off.
There is no reason for this.
Taken this URL.. https://mydomain.ok/whatever?foo=something
Should redirect to.. https://www.mydomain.ok/whatever?foo=something
Instead it currently redirects to.. https://www.mydomain.ok/whatever
Any help would be greatly appreciated. It's very hard to test this properly.
For the following, REDIRECT_TO_WEBSITE=www.domain.com
Here is the example configuration:
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"api": {
"matchCondition": {
"route": "/api/{*path}"
},
"backendUri": "https://%WEBSITE_HOSTNAME%/api/{path}"
},
"rest": {
"matchCondition": {
"route": "{*rest}"
},
"responseOverrides": {
"response.statusCode": "302",
"response.headers.Location": "https://%REDIRECT_TO_WEBSITE%/{rest}",
},
}
}
}
Found the answer on another SO question: Azure Function Proxies Multiple Query parameters with the same name
You simply need to add the
request.querystring
to thebackend.request.querystring
:So, your config would be:
It's worth pointing out that according to a commenter on that thread: "...going forward with .NET 6.0 onwards function proxies aren't supported, use API Management service instead"