locked
rewrite causing 500 errors RRS feed

  • Question

  • User-10909479 posted

    IIS 10, Windows 2K16, URL Rewrite 2.1.  The server has about 6 sites on it, 2 of which us rewrite rules.  Site #1 ran fine with it's rewrite rules until about 2 weeks ago when it would start go give random 500 errors.  We enabled failed request tracing which shows the error below.  When we disable the rules and access the URL directly, the error goes away, which is what we did on site #1.  #2 is our API and is a bit more complex to just eliminate the rules from.  The rewrite rules look like this:

    <httpErrors existingResponse="PassThrough" />
            <rewrite>
                <rules>
                    <rule name="ApiWithControllerAndId" stopProcessing="true">
                        <match url="^([^/]+)/([^/]+)/([^/]+)/?$" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.cfm?controller={R:1}&amp;method={R:2}&amp;id={R:3}" />
                    </rule>
                    <rule name="ApiWithController" stopProcessing="true">
                        <match url="^([^/]+)/([^/]+)/?$" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.cfm?controller={R:1}&amp;method={R:2}" />
                    </rule>
                </rules>
            </rewrite>

    All other sites that do not use rewrite in URL rewrite (we have some redirct rules but they're not effected) work fine.  The API site also works fine on a different, identical server.  At this point I'm out of ideas as to where to even look.  Tomcat indicates an IIS issue, IIS support people say it's a Tomcat issue etc.

    <fieldset><fieldset><fieldset><fieldset><fieldset><fieldset class="no-border" id="section_detail_52">
    FilterName D:\ColdFusion2018\config\wsconfig\1\isapi_redirect.dll
    </fieldset><fieldset class="no-border" id="section_detail_53">
    0 ms
    53. -FILTER_END
    NotificationStatus SF_STATUS_REQ_ERROR
    </fieldset></fieldset><fieldset class="no-border" id="section_detail_54" style="background-color: #ffffff;">
    0 ms
    Error
    54. -FILTER_ERROR
    ErrorCode Incorrect function. (0x1)
    </fieldset><fieldset class="no-border" id="section_detail_55">
    0 ms
    Informational
    55. -FILTER_AUTH_COMPLETE_END
    </fieldset></fieldset><fieldset class="no-border" id="section_detail_56">
    0 ms
    Warning
    56. -MODULE_SET_RESPONSE_ERROR_STATUS
    ModuleName IsapiFilterModule
    Notification AUTHENTICATE_REQUEST
    HttpStatus 500
    HttpReason Internal Server Error
    HttpSubStatus 0
    ErrorCode Incorrect function. (0x80070001)
    ConfigExceptionInfo
    </fieldset><fieldset class="no-border" id="section_detail_57">
    0 ms
    Verbose
    57. -NOTIFY_MODULE_END
    ModuleName IsapiFilterModule
    Notification AUTHENTICATE_REQUEST
    fIsPostNotificationEvent true
    NotificationStatus

    NOTIFICATION_FINISH_REQUEST

    </fieldset></fieldset></fieldset></fieldset>
    Tuesday, February 4, 2020 2:02 PM

All replies

  • User-2064283741 posted

    Well the error seems to be in the isapi_redirect.dll  which is a Tomcat redirection dll.

    Which for me it is in their camp.

    It seems like using the Microsofts URLrewrite module is probably changing something before it get there and the Tom redirect dll doesn't understand it.

    Compare the details (in failed request tracing) in the request  after it has done the URLrewrite part to a request when you have disabled the rule.

    I expect suitable differences there,

    Tuesday, February 4, 2020 7:16 PM
  • User-848649084 posted

    Hi,

    This is the tomcat related issue. you could try to use the arr instead of the tomcat redirector. The error code ERROR_INVALID_FUNCTION is generated by the ISAPI filter.

    you could also try to follow this below article:

    https://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

    Regards,

    Jalpa

    Wednesday, February 5, 2020 8:17 AM
  • User-848649084 posted

    Hi,

    Is your issue solved?

    If your issue is solved then I request you to mark the helpful suggestion as an answer. This will help other people who face the same issue.

    If your issue still exists then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Jalpa.

    Wednesday, March 4, 2020 2:43 AM