question

MarcioAbreu-0796 avatar image
0 Votes"
MarcioAbreu-0796 asked YurongDai-MSFT commented

IIS Rewrite CGI Error 404

on my IIS web.conf I have the following rule

<rule name="Rule1" enabled="true" stopProcessing="true">
<match url="mypath/(.*)" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}:{SERVER_PORT}" />
<set name="HTTP_REFERER" value="" />
<set name="HTTP_ORIGIN" value="" />
</serverVariables>
<action type="Rewrite" url="http://HOST_LAN_IP:8007/{R:1}" />
</rule>

when going to the page https://subdomain.domain.com/mypath, there are many errors was follows:

Loading failed for the <script> with source “https://subdom.domain.com/mypath/webapi/entry.cgi?api=SYNO.Core.Desktop.SessionData&version=1&method=getjs&launchApp=SYNO.SDS.AudioStation.Application&SynoToken=&v=1647950553”.

All content failing to load are cgi files and it is referred on the original page as
<script type="text/javascript" src="webapi/entry.cgi?api=SYNO.Core.Desktop.SessionData&version=1&method=getjs&launchApp=SYNO.SDS.AudioStation.Application&SynoToken=&v=1647950553"></script>

My guess is that IIS somehow is not properly handling the text/javascript type cgi, but I don't know if that is the case, and if so how to fix it!

windows-server-iis
· 1
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.

Hi @MarcioAbreu-0796,

Are you using Firefox browser? Try another browser to see if the same error occurs.

0 Votes 0 ·

1 Answer

MarcioAbreu-0796 avatar image
0 Votes"
MarcioAbreu-0796 answered YurongDai-MSFT commented

It’s not the browser, but the IIS rule is not keeping the proper routing for grabbing the content… it returned 302 followed by 404 when I traced the headers… (Web Developer mode in Network/ responses)
What variables should I use for preserving the proper address during the traffic of data between the proxy and the backend server?

· 1
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.

Hi @MarcioAbreu-0796,

If the IIS rule is not keeping the correct route to get the content, you can try to use Failed Request Tracking to view more detailed error information.


0 Votes 0 ·