Report this

What is the reason for this report?

Upstream sent too big header while reading response header from upstream, client

Posted on March 30, 2020

I have been getting lots of error like this:

2020/03/30 00:43:08 [error] 14208#14208: *336392707 upstream sent too big header while reading response header from upstream, client: 172.68.189.93, server: noteplus.com, request: "GET /*%20cyrillic-ext%20*/@font-face%20%7B%20%20font-family:%20'Roboto';%20%20font-style:%20normal;%20%20font-weight:%20300;%20%20src:%20local('Roboto%20Light'),%20local('Roboto-Light'),%20url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2)%20format('woff2');%20%20unicode-range:%20U+0460-052F,%20U+1C80-1C88,%20U+20B4,%20U+2DE0-2DFF,%20U+A640-A69F,%20U+FE2E-FE2F;%7D/*%20cyrillic%20*/@font-face%20%7B%20%20font-family:%20'Roboto';%20%20font-style:%20normal;%20%20font-weight:%20300;%20%20src:%20local('Roboto%20Light'),%20local('Roboto-Light'),%20url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2)%20format('woff2');%20%20unicode-range:%20U+0400-045F,%20U+0490-0491,%20U+04B0-04B1,%20U+2116;%7D/*%20greek-ext%20*/@font-face%20%7B%20%20font-family:%20'Roboto';%20%20font-style:%20normal;%20%20font-weight:%20300;%20%20src:%20local('Roboto%20Light'),%20local('Roboto-Light'),%20url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2)%20format('woff2');%20%20unicode-range:%20U+1F00-1FFF;%7D/*%20greek%20*/@font-face%20%7B%20%20font-family:%20'Roboto';%20%20font-style:%20normal;%20%20font-weight:%20300;%20%20src:%20local('Roboto%20Light'),%20local('Roboto-Light'),%20url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2)%20format('woff2');%20%20unicode-range:%20U+0370-03FF;%7D/*%20vietnamese%20*/@font-face%20%7B%20%20font-family:%20'Roboto';%20%20font-style:%20normal;%20%20font-weight:%20300;%20%20src:%20local('Roboto%20Light'),%20local('Roboto-Light'),%20url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2)%20format('woff2');%20%20unicode-range:%20U+0102-0103,%20U+0110-0111,%20U+0128-0129,%20U+0168-0169,%20U+01A0-01A1,%20U+01AF-01B0,%20U+1EA0-1EF9,%20U+20AB;%7D/*%20latin-ext%20*/@font-face%20%7B%20%20font-family:%20'Roboto';%20%20

and error like this too,

2020/03/30 04:24:24 [error] 14208#14208: *337435264 upstream sent too big header while reading response header from upstream, client: 172.68.142.79, server: noteplus.com, request: "GET /money-transaction/chapter-7/data:video/mp4;base64,%20AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmc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moAvwMkhAEmQAhkA

I have dig around and the possible solution is,

fastcgi_buffers 16 16k; 
fastcgi_buffer_size 32k;

Or adjust the size accordingly. But what I want to know is, what is causing such error and how to reduce the size of the header?

Any help is grateful.

Thank you



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

The error message upstream sent too big header while reading response header from upstream typically occurs when the web server is trying to read the response from an upstream server (such as a PHP-FPM process), and the response headers are larger than the buffer size configured for the server.

The values fastcgi_buffers and fastcgi_buffer_size are the settings in Nginx that determine the buffer size for reading the response from an upstream server. Specifically, fastcgi_buffers sets the number and size of the buffers, and fastcgi_buffer_size sets the size of the buffer used for reading the first part of the response.

Increasing these values can help to resolve this error. However, if the headers are extremely large, this may be a symptom of an issue with your application.

For instance, if your application is setting a lot of cookies or sending back a lot of custom headers, this can cause the response headers to become too large. In this case, you should review your application’s code to see if you can reduce the size of the headers it’s sending.

Alternatively, if you’re using a web application framework or a CMS, there might be plugins or modules that are adding extra headers to the response. Disabling unnecessary plugins or modules might help to reduce the size of the headers.

When you’re increasing the buffer size, you’re also using more memory on your server. So, while it might be a quick fix to just increase the buffer size, in the long run it’s better to try to understand why the headers are so large and if there’s anything you can do to reduce their size.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.