1

I am trying to deploy a static network speed test application. IIS need to behave like This Nginx Config.

Everything working fine, but I need to send 200 instead of 405. When Running Upload Test. (POST request to a Static File)

Looking for ISS Equivalent like 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>

1 Answers1

0

You can try it with rewrute rules. Make sure you change the match url directive according to what you need:

<rewrite>
    <rules>
        <rule name="customResponseCode">
            <match url=".*" />
            <action type="CustomResponse" statusCode="200" />
        </rule>
    </rules>
</rewrite>
GChuf
  • 266
  • 1
  • 7