Unable to get ServiceStack to work in IIS6 with HTTPS

I had a problem getting ServiceStack to work with HTTPS in IIS6, and I can not find any documentation on how to configure it. I currently have this endpoint setup - http://example.com/api.ashx . When I get to this, I will get a useful page with ServiceStack that explains the APIs available at http://example.com/api.ashx/metadata . When I look through https://example.com/api.ashx (https notification), I get this error message -

Server error in application "/". Resource could not be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could be deleted if their name was changed or Temporarily unavailable. Look at the following URL and make sure it is spelled correctly. Requested URL: /api.ashx

I have the following setup in my web.config (e.g. here - http://www.servicestack.net/ServiceStack.Hello/ ) -

<!-- ServiceStack: Required to host at: /api.ashx --> <location path="api.ashx"> <system.web> <httpHandlers> <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*"/> </httpHandlers> </system.web> 

In my local Windows 7 window, I run IIS7 and it works fine, but the test and live environments still use IIS6, and I can't get it to work there.

Other normal aspx pages work fine when using https.

I would be grateful to everyone who can give me a push in the right direction!

+7
source share
2 answers

The problem with IIS 6 is that the IIS 6.0 request pipeline does not recognize the path without the ASP.NET extension, for example .aspx is not passed to the ASP.NET ISAPI hander. So there are usually 2 options for this to happen so that you can run ServiceStack on IIS 6:

  • Change the servicestack path in Web.Config from '*' to 'servicestack.ashx'

    <system.web>

    <HttpHandlers> <add path = "servicestack.ashx" type = "ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb = "*" /> </HttpHandlers>

    </system.web>

  • Add a lookup mapping for your virtual directory to pass all raw requests to ASP.NET: Follow these steps to create a lookup map script with IIS 6.0:

    • Right-click the website and select "Properties"
    • Select the Home Directory tab
    • Click the "Configure" button
    • Select the Mappings tab
    • Click the "Insert" button (see. Fig. 4).
    • Paste the path to aspnet_isapi.dll in the Executable field (you can copy this path from the map script for .aspx files)
    • Uncheck "Check if file exists
    • Click OK

IIS 6.0 Wildcard mapping

+9
source

The answer to the myth did not help me.

I started by adding the location tag to web.config with the servicestack configuration. I found that servicestack worked with path = "*" - but took a lot of requests (Episerver), but solved it as follows:

 <location path="UniqueTag"> <system.web> <httpHandlers> <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" /> </httpHandlers> </system.web> </location> 

And then prefix all routes with UniqueTag:

 [Route("/UniqueTag/DeletePost/{Id}", Verbs = "POST")] 

But note that option 2 of the answer to the myth may also be required, since the default setting was set in our solution.

+1
source

All Articles