看到这个,我首先想到去压缩 filter 参数,找到压缩方法:
# aka compress
def deflate(str, level)
z = Zlib::Deflate.new(level)
dst = z.deflate(str, Zlib::FINISH)
z.close
dst
end
# aka decompress
def inflate(str)
zstream = Zlib::Inflate.new
buf = zstream.inflate(str)
zstream.finish
zstream.close
buf
end
处理参数后,尝试,错误还是发生。
然后更改 nginx.conf 修改 nginx 配置,也是为了压缩,
gzip on;
gzip_proxied any;
gzip_comp_level 2; # 压缩等级
gzip_min_length 1100;
gzip_types text/plain text/css application/javascript application/xml application/json text/javascript application/x-javascript;
重启 nginx,错误还是发生。
最后通过修改配置文件 sudo vim /etc/elasticsearch/elasticsearch.yml 解决问题。
http.max_initial_line_length: "8k" #default 4k
http.max_header_size: "16k" # default 8k
网友评论