Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring Nginx for large URIs

Tags:

nginx

I have a large URI and I am trying to configure Nginx to accept it. The URI parameters are 52000 characters in length with a size of 52kb. I have tried accessing the URI without Nginx and it works fine.

But when I use Nginx it gives me an error. --- 414 (Request-URI Too Large)

I have configured the large_client_header_buffers and client_header_buffer_size in the http block but it doesn't seem to be working.

client_header_buffer_size 5120k; large_client_header_buffers 16 5120k; 

Any help will be appreciated.

Thank you.

like image 298
sushmit sarmah Avatar asked May 19 '14 07:05

sushmit sarmah


People also ask

How do I fix 414 Request URI too large nginx?

In the case of the 414 Request-URI Too Large error, the problem is clear: the URLs being passed to the server are too big. To fix it, you'll need to change your Apache or Nginx server settings. This doesn't take too long, and once you're done, you should be back up and running.

How many RPS can nginx handle?

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

How many concurrent users can nginx handle?

NGINX can handle a maximum of 512 concurrent connections. In newer versions, NGINX supports up to 1024 concurrent connections, by default.

How many requests can nginx load balancer handle?

The configuration allows bursts of up to 12 requests, the first 8 of which are processed without delay. A delay is added after 8 excessive requests to enforce the 5 r/s limit. After 12 excessive requests, any further requests are rejected.


1 Answers

I have found the solution. The problem was that there were multiple instances of nginx running. This was causing a conflict and that's why the large_client_header_buffers wasnt working. After killing all nginx instances I restarted nginx with the configuration:

client_header_buffer_size 64k; large_client_header_buffers 4 64k; 

Everything started working after that.

Hope this helps anyone facing this problem.

like image 91
sushmit sarmah Avatar answered Oct 05 '22 01:10

sushmit sarmah