2017-06-06 2 views
2

Je reçois un 404 lors d'une redirection/réécriture d'URL, et je suis incapable de déterminer exactement ce qui le cause.Cet avertissement ARR provoque-t-il mon 404?

L'avertissement est:

REWRITE_DISABLED_KERNEL_CACHE

Voici mes règles:

<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> 

La règle de redirection semble fonctionner, comme je l'ai tfs.domain.com/tfs dans mon navigateur quand je accédez à tfs.domain.com.

Mais alors je reçois le 404. J'ai regardé les journaux de demande échoués, mais ils ne révèlent pas beaucoup. Il y a this question, mais je crains d'être complètement perdu quant à ce que la discussion veut dire. Peut-être que c'est la solution à mon problème, mais je n'ai aucune idée de ce dont ils parlent. C'est loin de ma tête, malheureusement. Alors, est-ce que ... l'avertissement ARR provoque le 404? Si non, comment puis-je trouver la cause première de ce problème?

Compact Voir

No. EventName      Details                                            Time 
--- ------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- 
1. GENERAL_REQUEST_START   SiteId="1", AppPoolId="DefaultAppPool", ConnId="1610612761", RawConnId="0", RequestURL="http://tfs.domain.com:80/favicon.ico", RequestVerb="GET"         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 
            Connection: keep-alive 
            Pragma: no-cache 
            Accept: image/webp,image/*,*/*;q=0.8 
            Accept-Encoding: gzip, deflate, sdch 
            Accept-Language: en-US,en;q=0.8 
            Host: tfs.domain.com 
            Referer: http://tfs.domain.com/tfs 
            User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like 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  Succeeded="true"                                         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 Redirect", RequestURL="https://tfs.domain.com/tfs", QueryString="", StopProcessing="true", Succeeded="true"               01:03:35.718 
29. REWRITE_DISABLED_KERNEL_CACHE                                              01:03:35.718 
     Warning 

30. GENERAL_SET_RESPONSE_HEADER  HeaderName="Location", 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 
            Location: https://tfs.domain.com/tfs 
            Server: Microsoft-IIS/10.0 
            X-Powered-By: ASP.NET 
            " 
36. GENERAL_RESPONSE_ENTITY_BUFFER Buffer="<head><title>Document Moved</title></head>                                 01:03:35.718 
            <body><h1>Object Moved</h1>This document may be found <a HREF="https://tfs.domain.com/tfs">here</a></body>" 
37. GENERAL_FLUSH_RESPONSE_END  BytesSent="370", ErrorCode="The operation completed successfully.                             01:03:35.718 
            (0x0)" 
38. GENERAL_REQUEST_END    BytesSent="370", BytesReceived="400", HttpStatus="301", HttpSubStatus="0"                           01:03:35.718

Répondre

1

Toutes vos règles regarder OK.

Il semble que vous ayez besoin d'activer la fonction de redirection proxy d'ARR qui est désactivée par défaut, REWRITE_DISABLED_KERNEL_CACHE donne également un indice à ce sujet.

Pour activer le transfert proxy; Ouvrez une invite de commande élevée sur le serveur et entrez la commande suivante.

appcmd.exe set config -section:system.webServer/proxy /enabled:"True" /commit:apphost 

Ou jetez un coup d'œil à Creating a Forward Proxy Using Application Request Routing.

+0

Bonne gracieuse, c'était tout. Comment diable une personne sait-elle ce genre de choses? – InteXX

+0

Ils apprennent en souffrant. Maintenant vous êtes l'un d'entre eux :) –

+0

lol je suppose :-) – InteXX