0

I have azure function app, where I want to use proxy to show static page to the users(which is hosted on another domain) after accessing the function app link like example below https://myfunctionapp1.azurewebsites.net/

{
    "$schema": "http://json.schemastore.org/proxies",
    "proxies": {
        "default": {
            "matchCondition": {
                "methods": [
                    "GET"
                ],
                "route": "/"
            },
            "backendUri": "https://my-site.azurewebsites.net/default.htm"

        }
    }
}

The above configuration I have done a year ago showing up the static page on same url, but now when I access the link https://myfunctionapp1.azurewebsites.net/ it is redirecting to https://my-site.azurewebsites.net/default.htm

Is there any new changes to azure function proxy documentation? If so please refer the link here Thanks & Regards

Kumari Dimple
  • 343
  • 2
  • 4
  • 14
  • Did you ever figure out how to get the old behaviour back? I am experiencing the same issue which is problematic as we want users in browsers to see the original URL and not the underlying backend URL which we want to be able to change and still affect potential bookmarks created by users in browsers. – michn Nov 30 '20 at 11:08

1 Answers1

0

I encountered a similar issue where the function proxy redirects the browser to the backend URI instead of showing the results from the backend URI on the proxy URL.

It turns out that if the backend URI replies with a 301 or 302 redirect the proxy will return this redirect to the user's browser and therefore the browser will perform a redirect instead of just showing the contents of the backend URI.

In my case this 301 redirect was caused by the backend URI being https://[domain].com which performed a redirect to https://www.[domain].com. Changing my backend URI to be https://www.[domain].com fixed the issue and it is now working as intended.

michn
  • 226
  • 3
  • 11