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 ...@@ -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. 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" For example, you can disable buffering in Nginx by setting `X-Accel-Buffering` to `no`:
server {
listen 80; ```js filename="next.config.js"
module.exports = {
location / { async headers() {
proxy_pass http://localhost:3000; return [
proxy_http_version 1.1; {
proxy_set_header Upgrade $http_upgrade; source: '/:path*{/}?',
proxy_set_header Connection 'upgrade'; headers: [
proxy_set_header Host $host; {
proxy_cache_bypass $http_upgrade; key: 'X-Accel-Buffering',
value: 'no',
# Disable buffering },
proxy_buffering off; ],
} },
]
},
} }
``` ```
......
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