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.

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

  • 相关阅读:
    PC版优酷的一次异常
    颜宁开讲啦谈理性思考
    李彦宏开讲啦谈判断能力
    尝试插入cctv视频
    selenium中quit与close方法的区别
    CodeForces 131C The World is a Theatre(组合数)
    CodeForces 446A DZY Loves Sequences(dp)
    UVA 1631 Locker(密码锁)(dp记忆化搜索)
    UVA 1630 Folding(串折叠)(dp记忆化搜索)
    UVA 1629 Cake slicing(切蛋糕)(dp记忆化搜索)
  • 原文地址:https://www.cnblogs.com/sunyuw/p/4210005.html
Copyright © 2011-2022 走看看