Error 404.4 The resource you are looking for does not have a handler associated with it

旧城冷巷雨未停 提交于 2020-06-27 11:54:25

问题


HTTP Error 404.4 - Not Found The resource you are looking for does not have a handler associated with it.

web.config

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />

                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:3000/{R:1}"  />
                </rule>

            </rules>
        </rewrite>

    </system.webServer>
    </location>
</configuration>

I want to redirect mywebsite.com to http://localhost:3000

  • mywebsite.com is in iis and host file
  • http://localhost:3000 is a nodejs running the website
  • I installed Application Request Routing and url-rewrite
  • I set iusr permission on site folder
  • The redirect works on my windows server 2016 but not on win 10

回答1:


You need to enable IIS to route the requests to nodejs.

First, download the Application Request Routing either by downloading on the IIS website or using the 'Web Platform Installer' in IIS Manager.

Next, on IIS Manager, select your server and under the IIS category, open Application Request Routing Cache.

On the right side of the screen, select 'Server Proxy Settings...' and tick enable proxy in the form.

After these steps, you may be able to connect to node correctly.

For reference: https://docs.microsoft.com/en-us/iis/extensions/configuring-application-request-routing-arr/creating-a-forward-proxy-using-application-request-routing




回答2:


I'm seeing two issues in the above code snippet, first of all the </location> seems to be out of place.

Second thing is that you use <action type="Rewrite" while you probably mean <action type="Redirect"



来源:https://stackoverflow.com/questions/50356301/error-404-4-the-resource-you-are-looking-for-does-not-have-a-handler-associated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!