这个 ARR 警告会导致我的 404 吗?

Int*_*eXX 7 iis url-routing arr

我在 URL 重定向/重写期间收到 404,我无法确定是什么导致了它。

警告是:

REWRITE_DISABLED_KERNEL_CACHE

这是我的规则:

<rule name="TFS Redirect" stopProcessing="true">
  <match url="^((?!tfs).)*$" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="tfs.domain.com" />
  </conditions>
  <action type="Redirect" url="http://tfs.domain.com/tfs" />
</rule>
<rule name="TFS Rewrite" stopProcessing="true">
  <match url="^tfs(.*)" />
  <action type="Rewrite" url="http://server3:8080/{R:0}" />
</rule>
Run Code Online (Sandbox Code Playgroud)

重定向规则似乎有效,因为tfs.domain.com/tfs当我浏览到tfs.domain.com.

但是后来我得到了 404。我查看了失败的请求日志,但它们并没有透露太多信息。有这个问题,但恐怕我对讨论的意思完全不知所措。也许这就是我问题的解决方案,但我不知道他们在说什么。不幸的是,这超出了我的想象。

那么......是ARR警告导致404吗?如果没有,我怎样才能找到这个问题的根本原因?

紧凑视图

编号 事件名称 详细信息 时间
--- ------------------------------- ---------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ------------- -------------
1. GENERAL_REQUEST_START SiteId="1", AppPoolId="DefaultAppPool", ConnId="1610612761", RawConnId="0", RequestURL="http://tfs.domain.com:80/favicon.ico", RequestVerb="获取”01:03:35.718
2. GENERAL_SET_REQUEST_HEADER HeaderName="AspFilterSessionId", HeaderValue="", Replace="true" 01:03:35.718
3. GENERAL_ENDPOINT_INFORMATION RemoteAddress="192.168.0.1", RemotePort="54278", LocalAddress="192.168.0.12", LocalPort="80" 01:03:35.718
4. GENERAL_REQUEST_HEADERS Headers="Cache-Control: no-cache 01:03:35.718
                                    连接:保持连接
                                    编译指示:无缓存
                                    接受:image/webp,image/*,*/*;q=0.8
                                    接受编码:gzip、deflate、sdch
                                    接受语言:en-US,en;q=0.8
                                    主机:tfs.domain.com
                                    推荐人:http://tfs.domain.com/tfs
                                    用户代理:Mozilla/5.0(Windows NT 10.0;Win64;x64)AppleWebKit/537.36(KHTML,如 Gecko)Chrome/58.0.3029.110 Safari/537.36
                                    DNT:1
                                    ”
5. GENERAL_GET_URL_METADATA PhysicalPath="", AccessPerms="513" 01:03:35.718
6. HANDLER_CHANGED OldHandlerName="", NewHandlerName="StaticFile", NewHandlerModules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule", NewHandlerScriptProcessor="", NewHandlerType="" 01:03:35.718
7. MODULE_PRECONDITION_NOT_MATCH Name="UrlRoutingModule-4.0", Precondition="managedHandler,runtimeVersionv4.0" 01:03:35.718
8. MODULE_PRECONDITION_NOT_MATCH Name="ScriptModule-4.0", Precondition="managedHandler,runtimeVersionv4.0" 01:03:35.718
9. MODULE_PRECONDITION_NOT_MATCH Name="OutputCache", Precondition="managedHandler" 01:03:35.718
10. MODULE_PRECONDITION_NOT_MATCH Name="Session", Precondition="managedHandler" 01:03:35.718
11. MODULE_PRECONDITION_NOT_MATCH Name="WindowsAuthentication", Precondition="managedHandler" 01:03:35.718
12. MODULE_PRECONDITION_NOT_MATCH Name="FormsAuthentication", Precondition="managedHandler" 01:03:35.718
13. MODULE_PRECONDITION_NOT_MATCH Name="DefaultAuthentication", Precondition="managedHandler" 01:03:35.718
14. MODULE_PRECONDITION_NOT_MATCH Name="RoleManager", Precondition="managedHandler" 01:03:35.718
15. MODULE_PRECONDITION_NOT_MATCH Name="UrlAuthorization", Precondition="managedHandler" 01:03:35.718
16. MODULE_PRECONDITION_NOT_MATCH Name="FileAuthorization", Precondition="managedHandler" 01:03:35.718
17. MODULE_PRECONDITION_NOT_MATCH Name="AnonymousIdentification", Precondition="managedHandler" 01:03:35.718
18. MODULE_PRECONDITION_NOT_MATCH Name="Profile", Precondition="managedHandler" 01:03:35.718
19. MODULE_PRECONDITION_NOT_MATCH Name="UrlMappingsModule", Precondition="managedHandler" 01:03:35.718
20. MODULE_PRECONDITION_NOT_MATCH Name="ServiceModel-4.0", Precondition="managedHandler,runtimeVersionv4.0" 01:03:35.718
21. URL_REWRITE_START RequestURL="/favicon.ico", Scope="Distributed", Type="Inbound" 01:03:35.718
22. RULE_EVALUATION_START RuleName="TFS Redirect", RequestURL="favicon.ico", QueryString="", PatternSyntax="Regex", StopProcessing="true", RelativePath="/" 01:03:35.718
23. PATTERN_MATCH Pattern="^((?!tfs).)*$", Input="favicon.ico", Negate="false", Matched="true" 01:03:35.718
24. CONDITIONS_EVALUATION_START LogicalGrouping="MatchAll" 01:03:35.718
25. CONDITION_EVALUATION Input="{HTTP_HOST}", ExpandedInput="tfs.domain.com", MatchType="Pattern", Pattern="tfs.domain.com", Negate="false", Succeeded="true" 01: 03:35.718
26. CONDITIONS_EVALUATION_END 成功=“真” 01:03:35.718
27. REDIRECT_ACTION Substitution="https://tfs.domain.com/tfs", RedirectURL="https://tfs.domain.com/tfs", AppendQueryString="true", RedirectType="Permanent" 01:03: 35.718
28. RULE_EVALUATION_END RuleName="TFS 重定向", RequestURL="https://tfs.domain.com/tfs", QueryString="", StopProcessing="true", Succeeded="true" 01:03:35.718
29. REWRITE_DISABLED_KERNEL_CACHE 01:03:35.718
        警告

30. GENERAL_SET_RESPONSE_HEADER HeaderName="位置", HeaderValue="https://tfs.domain.com/tfs", Replace="true" 01:03:35.718
31. URL_REWRITE_END RequestURL="https://tfs.domain.com/tfs" 01:03:35.718
32. GENERAL_SET_RESPONSE_HEADER HeaderName="X-Powered-By", HeaderValue="ASP.NET", Replace="false" 01:03:35.718
33. GENERAL_NOT_SEND_CUSTOM_ERROR Reason="SETSTATUS_SUCCESS" 01:03:35.718
34. GENERAL_FLUSH_RESPONSE_START 01:03:35.718
35. GENERAL_RESPONSE_HEADERS Headers="Content-Type: text/html; charset=UTF-8 01:03:35.718
                                    位置:https://tfs.domain.com/tfs
                                    服务器:Microsoft-IIS/10.0
                                    X-Powered-By: ASP.NET
                                    ”
36. GENERAL_RESPONSE_ENTITY_BUFFER Buffer="<head><title>文档已移动</title></head> 01:03:35.718
                                    <body><h1>移动的对象</h1>可以在<a HREF="https://tfs.domain.com/tfs">此处</a></body>找到此文档
37. GENERAL_FLUSH_RESPONSE_END BytesSent="370", ErrorCode="操作成功完成。01:03:35.718
                                    (0x0)"
38. GENERAL_REQUEST_END BytesSent="370", BytesReceived="400", HttpStatus="301", HttpSubStatus="0" 01:03:35.718

Kul*_*gin 5

你所有的规则看起来都不错。

似乎您需要启用默认情况下禁用的 ARR 的代理转发功能,REWRITE_DISABLED_KERNEL_CACHE也提供了有关它的线索。

启用代理转发;在服务器上打开提升的命令提示符并输入以下命令。

appcmd.exe set config  -section:system.webServer/proxy /enabled:"True"  /commit:apphost
Run Code Online (Sandbox Code Playgroud)

或者查看使用应用程序请求路由创建转发代理