We have 2 app services: foo.azurewebsites.net and bar.azurewebsites.net and have configured origin groups for both sites. We would like the front door to do path based routing: i.e.:
myfd.z01.azurefd.net/foo -> foo.azurewebsites.net
myfd.z01.azurefd.net/bar -> bar.azurewebsites.net
We can configure this to work using Patterns to match on the routes as /foo/* and /bar/* respectively. This works as expected.
Next, we want to rewrite the URL so that we don't get the initial /foo or /bar path sent to the web apps. In other words, the current setup produces the following:
myfd.z01.azurefd.net/foo/abc -> foo.azurewebsites.net/foo/abc
myfd.z01.azurefd.net/bar/def -> bar.azurewebsites.net/bar/def
What we want is:
myfd.z01.azurefd.net/foo/abc -> foo.azurewebsites.net/abc
myfd.z01.azurefd.net/bar/def -> bar.azurewebsites.net/def
So we set up a rewrite URL rule as follows:
| Setting | Value |
|---|---|
| Action | URL rewrite |
| Source pattern | /foo/ |
| Destination | / |
| Preserve unmatched path | Yes |
However, this does not appear to work. In the AzureDiagnostics logs we can see the rule is firing, but the URL is not being rewritten - it still contains /foo/. Is there something we are missing?

