Skip to content
Discussion options

You must be logged in to vote

The issues was caused by the "recommendations" of the Next.js documentation.
Here is the link: https://nextjs.org/docs/app/guides/self-hosting#streaming-and-suspense .
It suggested to add header that will disable Nginx buffering to make Next.js streaming work.
But it gave much more issues and performance degradation than fixed. Every resource server from Next.js upstream server was not cached by proxy at all.
To fix that all I need is to remove the following header from my next.config.js.

	async headers() {
		return [
			{
				source: '/:path*{/}?',
				headers: [
					{
						key: 'X-Accel-Buffering', //Dissable buffering for Nginx https://nextjs.org/docs/app/guides/self-hosting#streamin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by l-you
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant