How to set the allowed url length for a nginx request (error code: 414, uri too large)

后端 未结 2 1287
执笔经年
执笔经年 2020-11-28 05:38

I am using Nginx in front of 10 mongrels.

When I make a request with size larger then 2900 I get back an:

error code 414: uri too large

2条回答
  •  旧时难觅i
    2020-11-28 06:17

    From: http://nginx.org/r/large_client_header_buffers

    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.

    so you need to change the size parameter at the end of that line to something bigger for your needs.

提交回复
热议问题