我正在尝试部署一个静态网络速度测试应用。IIS需要表现得像这个Nginx Config。
一切正常,但我需要发送200,而不是405。运行上传测试时。(将请求发送到静态文件)
寻找类似于Nginx "error_page 405 =200“的国际空间站等价物
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />
<mimeMap fileExtension="." mimeType="application/octet-stream" />
</staticContent>
<urlCompression doStaticCompression="false" />
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-store, no-cache, no-transform, must-revalidate" />
</customHeaders>
</httpProtocol>
<caching enabled="false" enableKernelCache="false" />
<security>
<requestFiltering>
<verbs>
<add verb="POST" allowed="true" />
<add verb="GET" allowed="true" />
</verbs>
<fileExtensions>
<add fileExtension="." allowed="true" />
</fileExtensions>
<alwaysAllowedUrls>
</alwaysAllowedUrls>
<requestLimits maxAllowedContentLength="2147483647"/>
</requestFiltering>
</security>
</system.webServer>
</configuration>发布于 2022-05-14 18:33:53
你可以用鲁鲁特规则来试试。确保根据需要更改match url指令:
<rewrite>
<rules>
<rule name="customResponseCode">
<match url=".*" />
<action type="CustomResponse" statusCode="200" />
</rule>
</rules>
</rewrite>https://serverfault.com/questions/1100931
复制相似问题