🛠 Fix net::ERR_CONNECTION_CLOSED error for requests with large headers
By default, the Nginx server with enabled HTTP/2 protocol has 4KB limit per request header field. If you’ll try to send a request with a larger header, you can get net::ERR_CONNECTION_CLOSED or net::ERR_HTTP2_PROTOCOL_ERROR:
![](https://renset.dev/pictures/CleanShot-2021-05-28-at-00.33.40@2x.png)
To fix this issue, update your configuration by adding the following params to your server section:
server {
...
large_client_header_buffers 8 16k; # default 4 4k
http2_max_field_size 16k; # default 4k
...
}
💡 | Depending on your Nginx server version, required changes in config params can be different. Learn more on the official Nginx docs page: http://nginx.org/en/docs/http/ngx_http_v2_module.html |