question

AlexAllen-3503 avatar image
0 Votes"
AlexAllen-3503 asked SamWu-MSFT commented

IIS Reverse Proxy works for the website but images and video are not, getting a "404 Not found"

I believe this is a URL rewrite issue but I am unsure how to configure. I am sort of new to IIS rewrite so please excuse my ignorance:) The issue I am facing is I can log in and navigate website using reverse proxy with SSL normally. The only thing that does not work is the images and video streams will not load. When inspecting the webpage in Firefox I can see the 404 stating;

GET https://kodi.mydomain.cloud/image/image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f954%2fmovieposter%2fmission-impossible-5d6957f73ca05.jpg/

When I try to open in a browser, the browser appears to strip the ://https or the rewrite doesn't allow it to pass through.

https://kodi.mydomain.cloud/image/image%3A%2F%2Fhttps%253a%252f%252fassets.fanart.tv%252ffanart%252fmovies%252f954%252fmovieposter%252fmission-impossible-5d6957f73ca05.jpg%2F

I think this can be fixed in the URL rewrite but I'm not smart enough to figure that out and information I found with google only talks about other web platforms. I prefer IIS and do not want to switch to Apache or the others for this.

This is my rewrite, below code is more detailed error from using Firefox developer tool.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="HTTP Redirect" stopProcessing="true">
<match url="(.)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://kodi.mydomain.cloud/" />
</rule>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.
)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="http://192.168.88.6:9080/{R:1}" />
</rule>
</rules>
<outboundRules>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<directoryBrowse enabled="false" />
<security>
<requestFiltering allowDoubleEscaping="true" />
</security>
</system.webServer>
</configuration>

Firefox error
GET https://kodi.mydomain.cloud/image/image%3A%2F%2Fhttps%253a%252f%252fassets.fanart.tv%252ffanart%252fmovies%252f954%252fmovieposter%252fmission-impossible-5d6957f73ca05.jpg%2F
Status404
Not Found
VersionHTTP/1.1
Transferred281 B (82 B size)
Referrer Policystrict-origin-when-cross-origin

Notes:
Going to StaticIP:9080, 192.168.88.6:9080 or localhost:9080 the images work fine.

Applications:
IIS Version 6.2
Application Kodi

Thank You in advance.

windows-server-iis
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for pointing that out. Looks like a deep dive is needed. Wont hurt because I have some other sites that work on the surface but breaks using codecs and such.

0 Votes 0 ·

@AlexAllen-3503

GET https://kodi.mydomain.cloud/image/image://https%3a%2f%2fassets.fanart.tv%2ffanart%2fmovies%2f954%2fmovieposter%2fmission-impossible-5d6957f73ca05.jpg/

There are multiple https in your url, which url do you want to rewrite/redirect to another url? please post information about your issue, or you can also use failed request tracking to view detailed error information.

0 Votes 0 ·

Good eye, that crossed my mind as well. Is it possibly calling out to another website fanart? I don't believe so, I read in several forums stating this is a known issue and seems to be easily fixed using NGINX Reverse Proxy. Maybe something to do with Java script?

I would say even going via public IP its got bugs....

122070-kodidoubleh.jpg


0 Votes 0 ·
kodidoubleh.jpg (534.7 KiB)

@AlexAllen-3503 You can't troubleshoot your problem just based on these error messages. You need to get more detailed error messages, such as setup Failed Request Tracing, check in Event Viewer and check through the web log files. etc.

0 Votes 0 ·

0 Answers