js1983
js1983

Reputation: 320

How to disable HTTP1.1 and only use HTTP/2 in Windows Server 2016 and IIS 10?

Traffic to my site is using HTTP1.1, and I want to force the server to only use HTTP/2.

I'm running Windows Server 2016 and IIS 10. I've tried adding

but it is still serving HTTP1.1.

I'm obviously missing something here, but I'm not exactly sure what. Is what I'm asking for even possible?

Upvotes: 0

Views: 8741

Answers (1)

Ian Boyd
Ian Boyd

Reputation: 257001

From ServerFault:

  1. Download and install URL Rewrite.

  2. Add the following to your web.config file, to the <system.webServer> section:

    web.config

    <rewrite>
        <rules>
             <rule name="RequestBlockingRule1" patternSyntax="Wildcard" stopProcessing="true">
                 <match url="*" />
                 <conditions>
                     <add input="{SERVER_PROTOCOL}" pattern="HTTP/1.0" />
                 </conditions>
                 <action type="AbortRequest" />
             </rule>
         </rules>
     </rewrite>
    

This will refuse all HTTP 1.0 requests with a HTTP 504 error code.


After installing URL Rewrite, you can also configure rewrite rules in IIS Manager:

enter image description here

Upvotes: 0

Related Questions