IIS rewrite 400 error
Posted: Sun May 06, 2018 8:54 pm
Hi all, I'm using IIS 10 on a separate web server to send mediabrowser requests to my serviio server (both Windows Server 2016 VMs on the same physical server/network and my public domain and private windows domain are the same). I'm using Url Rewrite 2.0 with rules for both the /mediabrowser and /cds paths that work fine. The only problem I've been having is viewing certain content, namely the list of episodes of a TV series. The page fails to load completely and gives the below 400 error. It looks like it might be caused by the ^ and * symbols in the url (which would understandably mess up regex matching), but when I check the failed request logs in IIS it looks like it's matching and rewriting the url correctly. I'm a complete noob to url rewriting and have searched this forum and elsewhere extensively to try and figure out what's going on. Some online sources said this could be caused by IIS security settings, which I tried tweaking with some registry changes to no avail.
Anyway I've included the webconfig below, appreciate any help!
Anyway I've included the webconfig below, appreciate any help!
- Code:
<rewrite>
<rules>
<rule name="Serviio Inbound" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://serviio.mydomain.net:23424/{R:1}" logRewrittenUrl="true" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{PATH_INFO}" pattern="mediabrowser" />
<add input="{PATH_INFO}" pattern="cds" />
</conditions>
</rule>
</rules>
<outboundRules>
<rule name="Serviio Outbound" preCondition="ResponseIsHtml1" patternSyntax="ECMAScript" stopProcessing="true">
<match filterByTags="A, Form, Img, Link" pattern="^http://serviio.mydomain.net:23424/(.*)" />
<action type="Rewrite" value="https://media.mydomain.net/{R:1}" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{PATH_INFO}" pattern="mediabrowser" />
<add input="{PATH_INFO}" pattern="cds" />
</conditions>
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>