I have written an ASP.NET Web API which is basically an API gateway. The base URL of the gateway is http://localhost:88/ApiGateway
. The service I have implemented looks up some header values and cookies in order to route a request. Currently I use it for blue-green deployments.
When a header or cookie with a specific API-ID is found, the request is routed to the corresponding API.
For example, if the found API-ID is alpha-v1.7.4
, and the URL is http://localhost:88/gateway/app/login.html
, the request is routed to http://localhost:8080/app/alpha-v1.7.4/app/login.html
where the actual app or website resides.
This work perfectly when using OWIN and Katana. All URLs are routed correctly.
When installing the gateway in IIS, things are getting strange.
I have put a very verbose logging into the gateway which logs each request and the found route. On IIS I observe that the followings requests are reaching the gateway and are routed properly:
1: http://localhost:88/gateway/app/some_directory/
2: http://localhost:88/gateway/app/another_directory_with_a.dot/
3: http://localhost:88/gateway/app/some_path_no_trailing_slash
The following request do not reach the gateway:
4: http://localhost:88/gateway/app/no_trailing_slash_with_a.dot
5: http://localhost:88/gateway/app/index.html
To me it seems that IIS is letting pass any directory paths (i.e. with a trainling slash like .../.../directory/
), all resource path (i.e. with no trailing slash like .../.../resource
) which do not smell like a file (since they have not dot), but blocks paths which have no trailing slash but a dot inside (.../.../may_be_a.file
is blocked, but .../.../not_a.file/
passes).
Following these instruction did not work for me: How to disable Request Filtering for a specific website on IIS 7.5?
Any idea how to configure IIS to get this to work?