HerokuAgneTutorial
Tips & Tricks for Migrating to Router 2.0
Summary
Heroku Router 2.0 is generally available and is expected to become the default, making migration planning important before rollout. The guidance recommends creating a staging application, enabling the http-routing-2-dot-0 feature, restarting web dynos when needed, and checking response headers and system logs to confirm routing. Router 2.0 identifies requests with Via values such as “2.0 heroku-router” or “1.1 heroku-router,” and its logs add protocol, tls, and tls_version fields. HTTP/2 is enabled by default on custom domains with valid TLS certificates, while HTTP/2 can be disabled through a Labs feature. Keepalives are also enabled between the router and web dynos, but applications using recent Puma versions may need the keepalive opt-out because of a connection-handling bug.
Context
Router 2.0 is generally available and is set to become the default router. The migration guidance addresses validating applications in staging, confirming which router handles traffic, and identifying compatibility issues before the broader rollout.
Approach / What changed
Create a staging application that closely mirrors production, enable Router 2.0 with the Heroku CLI, restart web dynos if connections to the legacy router affect response times, and verify routing through HTTP headers and system logs. Test HTTP/2 and keepalives, disabling either with the documented Labs features when an application requires it.
Takeaways
HTTP/2 terminates at the Heroku router, which forwards HTTP/1.1 to the application; HTTP/2 support applies to custom domains, not the built-in herokuapp.com domain.
Router 2.0 log entries use protocol values such as http2.0 and http1.1 and can include tls and tls_version fields, unlike the legacy router’s https or http values.
Recent Puma versions can show significantly longer tail request latencies with Router 2.0 keepalives enabled; the http-disable-keepalive-to-dyno Labs feature provides an opt-out.
Source and freshness
- Source
- heroku.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.