HTTP/2 Support #10842
-
Hey guys, Many thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
HTTP/2 is typically a concern handled by your deployment step. For example, when deploying to Vercel, your deployment is automatically served over HTTP/2, compressed with Brotli/Gzip, and downloaded from a CDN edge nearest to your end-user. For self-hosting, it is best practice to configure your application behind Nginx (or another reverse proxy) for optimum performance. Nginx should handle HTTP/2, the HTTPS termination, Gzip compression, etc. If you must serve your application in production directly from a Node.js server, you can look at our |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the detailed response! Currently I have an HAProxy that takes HTTP/2 and turns it in HTTP/1.1. |
Beta Was this translation helpful? Give feedback.
-
with-http2 example throwing error | Also Next@^13.x.x is not working. Error Detail:
|
Beta Was this translation helpful? Give feedback.
-
I'm using nextjs 14 approuter, and i18n for localization export function middleware(request) { return i18nRouter(request, i18nConfig); export const config = { when i try to setup a custom server.js file for http/2, i'm getting this error |
Beta Was this translation helpful? Give feedback.
-
Would be cool to have an option for this built-in, which can be toggled in the next config |
Beta Was this translation helpful? Give feedback.
HTTP/2 is typically a concern handled by your deployment step.
For example, when deploying to Vercel, your deployment is automatically served over HTTP/2, compressed with Brotli/Gzip, and downloaded from a CDN edge nearest to your end-user.
For self-hosting, it is best practice to configure your application behind Nginx (or another reverse proxy) for optimum performance. Nginx should handle HTTP/2, the HTTPS termination, Gzip compression, etc.
Only the localhost traffic (between Nginx and Node) would be over HTTP/1.1, where the latency is effectively zero.
If you must serve your application in production directly from a Node.js server, you can look at our
with-http2
example.