Unverified Commit 5e807150 authored by Lee Robinson's avatar Lee Robinson Committed by GitHub

docs: streaming while self-hosting must disable buffering (#60943)

Closes https://github.com/vercel/next.js/issues/54667
parent 04860649
...@@ -216,6 +216,32 @@ When the application is reloaded, there may be a loss of application state if it ...@@ -216,6 +216,32 @@ When the application is reloaded, there may be a loss of application state if it
Vercel provides additional [skew protection](https://vercel.com/docs/deployments/skew-protection?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) for Next.js applications to ensure assets and functions from the previous build are still available while the new build is being deployed. Vercel provides additional [skew protection](https://vercel.com/docs/deployments/skew-protection?utm_source=next-site&utm_medium=docs&utm_campaign=next-website) for Next.js applications to ensure assets and functions from the previous build are still available while the new build is being deployed.
<AppOnly>
### Streaming and Suspense
The Next.js App Router supports [streaming responses](/docs/app/building-your-application/routing/loading-ui-and-streaming) when self-hosting. If you are using Nginx or a similar proxy, you will need to configure it to disable buffering to enable streaming.
```nginx filename="nginx.conf"
server {
listen 80;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# Disable buffering
proxy_buffering off;
}
}
```
</AppOnly>
<PagesOnly> <PagesOnly>
## Manual Graceful Shutdowns ## Manual Graceful Shutdowns
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment