title: Application gateway URL path-based routing always redirect to default backend pool
body: <p>I have configured 4 webapps behind Application gateway (ARM template):</p>
  
  <ul>
  <li>dummyapi1.azurewebsites.de/servicehosts/dummyapi1</li>
  <li>dummyapi2.azurewebsites.de/servicehosts/dummyapi2</li>
  <li>dummyapi3.azurewebsites.de/servicehosts/dummyapi3</li>
  <li>dummyapi4.azurewebsites.de/servicehosts/dummyapi4</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/r457V.png" rel="nofollow noreferrer">web app settings</a></p>
  
  <p>I can open web apps when I go directly to  dummyapiX.azurewebsites.de/servicehosts/dummyapiX.</p>
  
  <p>I want routing work this way: when I go to <a href="https://PIPofApplicationGateway/servicehosts/dummyapiX" rel="nofollow noreferrer">https://PIPofApplicationGateway/servicehosts/dummyapiX</a> it should redirect to </p>
  
  <p>dummyapiX.azurewebsites.de/servicehosts/dummyapiX</p>
  
  <p>But Application Gateway always redirect to default backend pool, therefore I get 404 error.</p>
  
  <p>I created Custom probes that point to:</p>
  
  <ul>
  <li>/servicehosts/dummyapi1</li>
  <li>/servicehosts/dummyapi2</li>
  <li>/servicehosts/dummyapi3</li>
  <li>/servicehosts/dummyapi4</li>
  </ul>
  
  <p>Backend health show Healthy status for all. Backend pools point to webapps FQDN. PickHostNameFromBackendAddress for httpsSettings and PickHostNameFromBackendHttpSettings for probes are set to true. No other Path related setting are not configured in httpsSettings.</p>
  
  <p>The only path-based rule is:</p>
  
  <ul>
  <li>default backendpool  is dummyapi4</li>
  <li>"/servicehosts/dummyapi1/*" to backendpooldummy1</li>
  <li>"/servicehosts/dummyapi2/*" to backendpooldummy2</li>
  <li>"/servicehosts/dummyapi3/*" to backendpooldummy3</li>
  </ul>
  
  <p>Any suggestion? What might be a root cause?</p>