IIS ISAPI Redirect using Relative not Absolute URL

Jeff Phillips 1 Reputation point
2021-10-05T12:30:17.457+00:00

I'm using IIS as the frontend for a tomcat process running my CA service. An ISAPI redirect is used to pass the queries to the tomcat workers matching the URL /csrscep/... In our lab we have two devices from different vendors, the first works fine and uses HTTP/1.1 and a relative URI in the GET method:
GET /csrscep/123?operation=GetCACert&message=GetCACert HTTP/1.1 HOST=192.168.111.211

The non-working device uses HTTP/1.0 and an absolute URI in the GET method:
GET http://192.168.111.221/123?operation=GetCACert&message=GetCACert HTTP/1.0

For the first device the isapi handler passes the RequestURL=/csrscep/123 and the tomcat workermapper.properties correctly maps to the worker for /csrcsep

For the second device the isapi handler passes the RequestURL=http://192.168.111.221/123 which causes tomcat to report the error "URI does not begin with '/'" which is the result of the tomcat normalize servlet.

It's not possible to change the request behavior of the second device so I was trying to find a way to rewrite the RequestURL that is passed to the ISAPI Redirect handler but have not had any success. URL Rewrite looks only at the portion after the '/' so I tried to make a generic match all "(^.*)" pattern to match all URLs and rewrite the same value "{R:0}" hoping that it would recraft the RequestURL. This doesn't seem to be the case and looking at the failedRequest tracing log I surmise that the IIS processes are correctly parsing out the relative URI but passing the original absoluteURI to the isapi redirect module.

Any suggestions on how to rewrite the request prior to the isapi redirect module to correct the observed behavior?

Thanks
Jeff

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,246 questions
{count} votes