zoukankan      html  css  js  c++  java
  • (转)Request Header Or Cookie Too Large(Nginx config)

    看到huoding.com上有比较好的帖子,于是理解并用自己的话来描述啦

    加大client_header_buffer_size和large_client_header_buffers可以解决问题,但是为毛要两个参数来控制呢?一个不久可以满足要求了么?

    client_header_buffer_size用来缓存请求头,如果超过的话就会返回400错误了。但是如果绝大多数请求不会超过这个值的话,那么更大的请求头可以受large_client_headers_buffers的影响。

    还是贴nginx的原话吧

    • client_header_buffer_size: Sets buffer size for reading client request header. For most requests, a buffer of 1K bytes is enough. However, if a request includes long cookies, or comes from a WAP client, it may not fit into 1K. If a request line or a request header field does not fit into this buffer then larger buffers, configured by the large_client_header_buffers directive, are allocated.
    • large_client_header_buffers: 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.

    用两个参数来控制缓存大小的原因是为了平衡内存资源和处理速度的矛盾。

  • 相关阅读:
    php生成二维码的几种方式
    CVPR 2013
    面试&笔试---c语言之字符串处理
    逆向知识-汇编寻址方式汇总
    tensorflow中的lstm的state
    图文相关性 flickr数据实验结论_1
    LightGBM中GBDT的实现
    Tensorflow 变量的共享
    Tensorflow 变量的共享
    https://github.com/chenghuige/tensorflow-exp/blob/master/examples/sparse-tensor-classification/
  • 原文地址:https://www.cnblogs.com/sunyuw/p/4210005.html
Copyright © 2011-2022 走看看