Configuring Nginx for Large URIs

I have a large URI and am trying to configure Nginx to accept it. The URI parameter is 52,000 characters in length and 52 KB in size. I tried to access the URI without Nginx and it works fine.

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

I configured large_client_header_buffers and client_header_buffer_size in the http block, but it does not seem to work.

client_header_buffer_size 5120k; large_client_header_buffers 16 5120k; 

Any help would be appreciated.

Thanks.

+6
source share
1 answer

I have found a solution. The problem was that there were multiple instances of nginx. This caused a conflict and why the large_client_header_buffers file did not work. After destroying all instances of nginx, I restarted nginx with the configuration:

 client_header_buffer_size 64k; large_client_header_buffers 4 64k; 

After that, everything began to work.

Hope this helps someone facing this issue.

+18
source

Source: https://habr.com/ru/post/969499/


All Articles