Unverified Commit 524f4c81 authored by Lee Robinson's avatar Lee Robinson Committed by GitHub

docs: clarify nginx buffering disable (#61010)

https://github.com/vercel/next.js/pull/60943#issuecomment-1904413114
parent cf0f090f
......@@ -222,21 +222,23 @@ Vercel provides additional [skew protection](https://vercel.com/docs/deployments
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;
}
For example, you can disable buffering in Nginx by setting `X-Accel-Buffering` to `no`:
```js filename="next.config.js"
module.exports = {
async headers() {
return [
{
source: '/:path*{/}?',
headers: [
{
key: 'X-Accel-Buffering',
value: 'no',
},
],
},
]
},
}
```
......
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