For the second time in 3 years I came across the classic NGINX HTTP 414 URI Too Large. Hopefully this video gives quick diagnostic heads-up to those who have not encountered the 414 yet.
In this case, an external web service we consumed was using KONG and it seemed to have the default nginx configuration. As I had experienced this before, I quickly knew what was going on based on our client's request, server response code and shipped a fix :)
If you use KONG (api gateway from mashape) or an NGINX base web server, then it will by default have a maximum large_client_header_buffers size of 8k. Yes there are limits to the size of HTTP headers and HTTP URL Length :D
If you would like to increase the size of the query string or headers size then you can override these defaults and restart all nginx nodes.
So be mindful of this, if you see web services accepting lists of strings, uuids etc. They are likely not unlimited!!!
From the nginx docs:
Syntax: large_client_header_buffers number size;
Default: large_client_header_buffers 4 8k;
Context: http, server
Sets the maximum number and size of buffers used for reading large client request header. A request line cannot exceed the size of one buffer, or the 414 (Request-URI Too Large) error is returned to the client. A request header field cannot exceed the size of one buffer as well, or the 400 (Bad Request) error is returned to the client. Buffers are allocated only on demand. By default, the buffer size is equal to 8K bytes. If after the end of request processing a connection is transitioned into the keep-alive state, these buffers are released.
NGINX HTTP large client header buffer (increase nginx default url length / size)
http://nginx.org/en/docs/http/ngx_htt...
KONG API Gateway
https://konghq.com/
NGINX - web server, load balancer, reverse proxy, http cache etc
https://www.nginx.com/
Sorry for the wind noise! Will get a wind block soon !
I hope you enjoyed the quick tip and view!
Cheers!
Philip