Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 9 posts 90 karma points
    Oct 31, 2021 @ 22:43
    Dan
    0

    Custom Http Handler working locally but not on Azure App service

    Hi all,

    I am having an issue with a http handler, it is running fine on local but when deployed to our azure test server it does not get hit.

    The server is 32bit running iis10.

    The idea of this handler is to try find existing media when a 404 is initially returned by the umbraco media handlers. I have added the below into the webconfig

      <location path="media">
    <system.webServer>
      <handlers>
        <remove name="StaticFileHandler" />
        <add name="StaticFileHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.StaticFileHandler" />
        <remove name="Media404Handler" />
        <add name="Media404Handler" preCondition="integratedMode" verb="*" path="*.ashx" type="project.Handlers.MediaHandler, assemblyname, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      </handlers>
      <httpErrors errorMode="Custom" existingResponse="Replace">
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" path="/Handlers/MediaHandler.ashx" responseMode="ExecuteURL" />
      </httpErrors>
    </system.webServer>
    

    And again in the overal web.server config under (<handlers accessPolicy="Read, Write, Script, Execute">):

          <add name="Media404Handler" preCondition="integratedMode" verb="*" path=".ashx" type="project.Handlers.MediaHandler, assemblyname, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    

    Any help would be greatly appreciated!

    Cheers, Dan

Please Sign in or register to post replies

Write your reply to:

Draft