Heroku Labs: Disabling HTTP/2 for Router 2.0
Last updated November 15, 2024
For Common Runtime apps on Router 2.0, HTTP/2 is enabled by default. To opt-out of HTTP/2 enable the Heroku Labs http-disable-http2
feature.
Features added through Heroku Labs are experimental and subject to change.
Overview
By enabling the Heroku Labs feature, requests to your app use the HTTP/1.1 protocol or an older HTTP protocol if supported.
Disable HTTP/2 for Apps on Router 2.0
To opt out of using HTTP/2 as the default protocol, enable the Heroku Labs feature:
$ heroku labs:enable http-disable-http2 -a <app name>
You can verify your app is receiving HTTP/1.1 requests by referencing the protocol
value in your Heroku Router Logs, like this example:
2024-10-25T16:01:10.881983+00:00 heroku[router]: at=info method=GET path="/" host=my-app.example.com request_id=370b21e2-7dec-1758-6a80-e21f155dd635 fwd="138.68.186.89" dyno=web.1 connect=0ms service=0ms status=200 bytes=0 protocol=http1.1 tls=true tls_version=tls1.3
Enable HTTP/2 for Apps on Router 2.0
To opt back in to HTTP/2, disable the Heroku Labs feature:
$ heroku labs:disable http-disable-http2 -a <app name>
For more information on using HTTP/2 on Router 2.0, see the HTTP/2 considerations.
You can verify your app is receiving HTTP/2 requests by referencing the protocol
value in your Heroku Router Logs, like this example:
2024-10-25T16:01:10.881983+00:00 heroku[router]: at=info method=GET path="/" host=my-app.example.com request_id=370b21e2-7dec-1758-6a80-e21f155dd635 fwd="138.68.186.89" dyno=web.1 connect=0ms service=0ms status=200 bytes=0 protocol=http2.0 tls=true tls_version=tls1.3