smoyer
smoyer

Reputation: 8222

Azure App Service For Linux HTTP 2 not working

I have an app service for linux running .NET 5 on Azure, with HTTP 2 set in the configuration section

HTTP 2 enabled

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

Answers (1)

Jason Pan
Jason Pan

Reputation: 21838

UPDATE

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.

enter image description here

Upvotes: 0

Related Questions