diff --git a/context/nextjs/etc/nginx/templates/default.conf.template b/context/nextjs/etc/nginx/templates/default.conf.template index 9652600..1d4b24f 100644 --- a/context/nextjs/etc/nginx/templates/default.conf.template +++ b/context/nextjs/etc/nginx/templates/default.conf.template @@ -12,7 +12,10 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - location /_next/webpack-hmr { + # Dev HMR websocket. Turbopack (Next 16 default) uses /_next/hmr, webpack + # uses /_next/webpack-hmr. A failed upgrade breaks client hydration, so + # cover both. Regex beats the `location /` prefix, so these still match here. + location ~ ^/_next/(webpack-)?hmr { proxy_pass ${NGINX_PROXY_PASS}; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;