Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用IIS ApplicationInitialization remapManagedRequestsTo功能时,是否返回用于服务静态html的自定义响应代码?_Html_Asp.net_Iis_Warm Up - Fatal编程技术网

使用IIS ApplicationInitialization remapManagedRequestsTo功能时,是否返回用于服务静态html的自定义响应代码?

使用IIS ApplicationInitialization remapManagedRequestsTo功能时,是否返回用于服务静态html的自定义响应代码?,html,asp.net,iis,warm-up,Html,Asp.net,Iis,Warm Up,我目前正在使用IIS的功能来预热我的ASP.NET应用程序。我已经将属性remapManagedRequests设置为“warmup.html” <applicationInitialization remapManagedRequestsTo="warmup.html" skipManagedModules="true" doAppInitAfterRestart="true" > <add initializationPage="/home" /> <

我目前正在使用IIS的功能来预热我的ASP.NET应用程序。我已经将属性remapManagedRequests设置为“warmup.html”

<applicationInitialization remapManagedRequestsTo="warmup.html" skipManagedModules="true" doAppInitAfterRestart="true" >
  <add initializationPage="/home" />  
  <add initializationPage="/about-us" />      
</applicationInitialization>
将状态代码从200更改为555,以提供warmup.html,它确实更改了状态代码,但不提供warmup.html中的内容

<rewrite>
  <rules>
    <rule name="Change warm up status code" stopProcessing="true">
      <match url="warmup.html" />          
      <action type="CustomResponse" statusCode="555" subStatusCode="0"/>        
  </rule>
</rules>
</rewrite>
<system.webServer>
    <httpErrors errorMode="Custom">
        <error statusCode="555" path="warmup.html" responseMode="File" />
    </httpErrors>
</system.webServer>


有没有一种方法可以同时提供warmup.html的内容和返回一个自定义状态代码555

终于在

事实证明,我必须删除两个属性remapManagedRequests toskipManagedModules(默认值为false),这使我们

<applicationInitialization doAppInitAfterRestart="true">
  <add initializationPage="/home" />  
  <add initializationPage="/about-us" />      
</applicationInitialization>
然后将状态555捕捉为自定义错误,并引导用户进入友好的预热页面warmup.html

<rewrite>
  <rules>
    <rule name="Change warm up status code" stopProcessing="true">
      <match url="warmup.html" />          
      <action type="CustomResponse" statusCode="555" subStatusCode="0"/>        
  </rule>
</rules>
</rewrite>
<system.webServer>
    <httpErrors errorMode="Custom">
        <error statusCode="555" path="warmup.html" responseMode="File" />
    </httpErrors>
</system.webServer>