Reputation: 8222
I have an app service for linux running .NET 5 on Azure, with HTTP 2 set in the configuration section
However, traffic is still getting served using HTTP 1.1. My understanding is SSL is required for HTTP 2, and I am currently using the https://*.azurewebsites.com domain to access it. I think that azure does SSL termination at that point, and my app will get a regular http connection. Could that be why it still gets served using http 1.1? I am using ASP.NET Core, and if I run the site locally it gets served as HTTP 2.
Is there something else that I'm missing?
EDIT: I enabled/disabled the "Allow client certificates" checkbox on the configuration page, and it started serving it up on HTTP 2. I guess that forced some kind of refresh on Azure's end? It was getting served using http 2 for awhile but is back to http 1.1 now.
Upvotes: 1
Views: 556
Reputation: 21838
Add below code in appsettings.json, then try it.
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
},
Try to use another browser, like chrome or firefox. Or open a new InPrivate window, like below.
Reason: It should be caused by the browser cache. Clearing the cache can also solve the problem.
Upvotes: 0