How to increase the size of the GET request to place parameters larger than 10KB in NGINX and PHP?

6

I need to make a very large GET request with NGINX and PHP. Is there any configuration in NGINX or PHP that solves this?

    
asked by anonymous 25.02.2014 / 16:01

2 answers

4

Change the large_client_header_buffers directive.

  

  •      

    The request line can not be bigger than the size of one buffer, if the client sends a larger header nginx returns error "Request URI too large" (414).

         

    The longest header line of request also needs to be buffered, otherwise the client will get the "Bad request" (400) error.

         

    Buffers are separated only as needed.

         

    By default the size of one buffer is 8192 bytes. In the old nginx, this is equal to the size of the page, depending on the platform, either 4K or 8K, if at the end of the working request, it converts to state keep-alive, then these buffers are freed.

  • Translating:

      

    This directive assigns a maximum number and size of buffers to long headers read from the client request.

         

    The request line can not be larger than the buffer size, and if the client sends a header nginx will return an "Request URI too large" error (414).

         

    The largest row of the header can also not be larger than the size of a buffer, otherwise the client will receive an "Bad request" (400) error.

         

    Buffers are only separated if necessary.

         

    By default, the size of a buffer is 8192 bytes. In old nginx, this is equivalent to page size - depending on the platform, it is 4K or 8K; if at the end of the current request the connection acquires the keep-alive state, then these buffers are freed.

    Reference: link

        
    25.02.2014 / 17:04
    1

    The maximum size of the GET is usually limited on both the server and the client, and this limit is usually 8KB. If the client is going through a proxy, there is probably a limit there as well. That is, if you need GET requests greater than this, you will have to check the settings for all of them.

        
    26.02.2014 / 16:07