Reputation: 320
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
EnableHttp2Tls: DWORD
= 1
EnableHttp2ClearText: DWORD
= 1
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
Reputation: 257001
From ServerFault:
Download and install URL Rewrite.
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:
Upvotes: 0