jrtolle wrote:My reverse proxy (ARR/URL Rewrite on IIS) is unable to rewrite the data in the m3u8 file because it is not html (and my attempts at getting it to change non-html data have caused other parts of mediabrowser and the cds API to not work).
I have managed to get this working for mediabrowser, but for some reason, ServiiGo (my only other "external" client) still does not work, even after verifying the m3u8 file works (playing it on VLC from a Windows computer works fine, but the same link fails on VLC on my Android phone). The VLC debug logs on the phone are not very helpful, but with MediaBrowser working, that is an acceptable workaround for now. If using ARR/URL Rewreite on IIS, add the following rewrite rules to /cds and /mediabrowser. Make sure to change internal.server.name, external.domain.com, ports, and /cds/ where appropriate. Basically, it forces all content from Serviio to be not compressed at all, and checks not gzipped and not chunked content for the internal server name and rewrites it.
- Code:
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://internal.server.name:23424/cds/{R:1}" />
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="identity" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="http://internal.server.name:23424/(.*)" />
<action type="Rewrite" value="https://external.domain.com/{R:1}" />
</rule>
<rule name="RewriteAllInternal" preCondition="NotEncoded" enabled="true">
<match filterByTags="None" pattern="http\:\/\/internal\.server\.name:23424" />
<action type="Rewrite" value="https://external.domain.com" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="NotEncoded">
<add input="{RESPONSE_CONTENT_ENCODING}" pattern="^gzip" negate="true" />
<add input="{RESPONSE_TRANSFER_ENCODING}" pattern="^chunked$" negate="true" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>