问题
I want to redirect a URL-path in my Azure Web App service to another URL-path using Azure Application Gateway. How to avoid redirection to include the original path?
I have an ASP.NET framework 4.7 Web App service in Azure with two APIs:
https://myapp.azurewebsites.net/api/values/{int} -> respons 200
https://myapp.azurewebsites.net/api/forbidden -> respons 403
Then I have an App Gateway
http://myapp.northeurope.cloudapp.azure.com
With path-based route
http://myapp.northeurope.cloudapp.azure.com -> https://myapp.azurewebsites.net (works ok)
And a permanent redirect to "external site"
/api/values/* -> http://myapp.northeurope.cloudapp.azure.com/api/forbidden
Now when I go to a path /api/values/1 it redirects me wrong to /api/forbidden/api/values/1
http://myapp.northeurope.cloudapp.azure.com/api/values/1 -> http://myapp.northeurope.cloudapp.azure.com/api/forbidden/api/values/1 !!!
Means redirection includes the origin path! "Include path" is not checked and greyed-out in configuration.
I only want to restrict the access to some API-path from public Internet.
来源:https://stackoverflow.com/questions/60300686/how-to-route-to-another-path-with-azure-application-gateway