Read the signal
Start with the exact wording of the error and its timestamp in the log. Then narrow down the cause before changing anything.
2026/10/23 08:47:55 [error] 1234#1234: *7890 upstream sent too big header while reading response header from upstream, client: 198.51.100.7, server: cloud.beispiel.de, request: "GET /apps/user_saml/saml/acs HTTP/2.0"
Narrow down possible causes
- Large or many
Set-Cookieheaders, typical after SSO logins (SAML, OIDC) with long tokens. - Long
Content-Security-PolicyorLinkheaders. - Default 4 KB / 8 KB buffers (
fastcgi_buffer_size,proxy_buffer_size) are too small. - Application debug output ends up in headers.
Check before changing anything
1.
Find the error in the nginx log
grep 'too big header' /var/log/nginx/error.log | tail -n 5
2.
Measure the response header size
curl -s -o /dev/null -w '%{size_header}\n' https://cloud.example.com/
3.
Look at the full headers
curl -sI https://cloud.example.com/login
4.
Show current buffer settings
nginx -T 2>/dev/null | grep -E 'fastcgi_buffer|proxy_buffer'
Fix and test again
- For PHP-FPM:
fastcgi_buffer_size 32k;andfastcgi_buffers 16 16k;in the matchinglocationblock. - For a reverse proxy:
proxy_buffer_size 16k;,proxy_buffers 8 16k;,proxy_busy_buffers_size 32k;. - Apply with
nginx -t && systemctl reload nginx. - Reduce unnecessary or duplicate cookies in the application.
Then repeat the original action and compare the result with the initial error.
Keep a note for the next ticket
Record the exact error, the check result, the change and the retest. That gives the team a useful starting point next time.
Why does it only happen after the SSO login?
On the redirect back from the identity provider the application sets several session and SAML cookies at once. That one response overflows the buffer.
Full error guide: nginx: upstream sent too big header while reading response header
Originally published at daniele-michelin.com. More guides, free checks (SPF, TLS, headers) and an error-message lexicon: daniele-michelin.com/en/.
Top comments (0)