Inbound rules not working with Custom rewrite providerRSS

3 replies

Last post Aug 07, 2019 07:35 AM by kalpesh boghara

  • Inbound rules not working with Custom rewrite provider

    Aug 05, 2019 01:18 PM|kalpesh boghara|LINK

    I am trying to implement Custom rewrite provider for inbound rules.

    But I don't know why it's not working into server.
    I have 2 servers like
    Server1 and Server2
     it's working  fine into Server1  but same web.config file not working into Server2
    I have tried with add log into txt file but not get any log into Server2
    Same thing working fine into Server1.

    Here Server2 is newly purchase or I have configured all the required settings.

    I have also test this same thing with many other serve as well.  So into that it's working fine.

    I can't able to find what going wrong here.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                        <match url="(.*)" />
                        <action type="Rewrite" url="https://www.origin.com/{R:1}" />                   
                    </rule>
                    <rule name="InboundRules" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{Inbound:log.here}" pattern="(.+)" />
                        </conditions>
                        <serverVariables>
                            <set name="RESPONSE_output" value="{C:1}" />
                        </serverVariables>
                        <action type="Rewrite" url="{C:1}" />
                    </rule>
                </rules>
    <providers>
    <provider name="Inbound" type="ReplaceProvider.ReplaceProvider, ReplaceProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8af7a11b9f392524" />
    <provider name="Outbound" type="ReplaceProvider.OutBoundProvider, ReplaceProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8af7a11b9f392524" />
    </providers>
    <outboundRules>
    <clear />
    <rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
    <match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="true" />
    <action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
    </rule>
    <rule name="Remove origin" preCondition="IsHtml">
    <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script, CustomTags" customTags="option" pattern="(.*)www.origin.com(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="true">
    <add input="{Outbound:www.rewrite.com}" pattern="(.+)" />
    </conditions>
    <action type="Rewrite" value="{C:1}" />
    </rule>
    <preConditions>
    <preCondition name="IsHtml">
    <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
    </preCondition>
    <preCondition name="NeedsRestoringAcceptEncoding">
    <add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
    </preCondition>
    </preConditions>
    <customTags>
    <tags name="option">
    <tag name="option" attribute="value" />
    </tags>
    </customTags>
    </outboundRules> </rewrite> </system.webServer> </configuration>



  • Re: Inbound rules not working with Custom rewrite provider

    Aug 06, 2019 03:29 AM|Able|LINK

    Hi kalpesh,

    According to your description,I suggest that you could use FRT to troubleshoot the rewrite rule.Here is the link,I hope it could help you.

    https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules

    Best Regards

    Able

    Please remember to click "Mark as Answer" the responses that resolved your issue.
    If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
  • Rovastar Rovastar

    5446 Posts

    MVP

    Moderator

    Re: Inbound rules not working with Custom rewrite provider

    Aug 06, 2019 04:40 PM|Rovastar|LINK

    I have never used custom rewrite providers before but I would ahve thought somewhere in teh config there should be a reference to it.

    like:

    <rewrite>
        <providers>
            <provider name=
    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: Inbound rules not working with Custom rewrite provider

    Aug 07, 2019 07:35 AM|kalpesh boghara|LINK

    Rovastar

    I have never used custom rewrite providers before but I would ahve thought somewhere in teh config there should be a reference to it.


    I have updated my question so please check that.

    Thanks