问题
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 iniis
and host filehttp://localhost:3000
is a nodejs running the website- I installed
Application Request Routing
andurl-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