Configuring Nginx for large URIs

2019-03-19 06:04发布

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.

标签: nginx
1条回答
仙女界的扛把子
2楼-- · 2019-03-19 06:11

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.

查看更多
登录 后发表回答