How to get a big post data?


#1

I need save post data to file,
So setting
global
tune.bufsize 8650752
tune.maxrewrite 16384

frontend node-save-post
bind :8080
mode http
option http-buffer-request

After a few hours of running the program
I got this

runtime error: /root/lua/haproxy1.lua:203: Lua: ‘start_response’: response header block too big.


#2

The error is about the response, not the post data. So you may want to take a look at that.

Also, it would probably be useful if you would include informations about what you are actually trying to do, the complete configuration, and the lua script.

If it wouldn’t be for the error message, we wouldn’t even know that this is about a LUA script …


#3

core.register_service(“check_services”, “http”, function(applet)
local admin_path = fs.s_split(applet.path,’/’,3)
local msg = "error!"
if (admin_path[3] ~= nil and admin_path[3] ~= “”) then
local hash = fs.hexdecode(admin_path[3])
if hash ~= nil then
local cache = applet:get_var(‘proc.’…hash)
if not cache then
msg = 'exist’
end
end
end
applet:set_status(200)
applet:add_header(“Content-Type”, “text/plain”)
applet:add_header(“Server”, version)
applet:start_response()
applet:send(msg)
end)


#4

this just check url, if set tune.bufsize 16384,not this bug.


#5

HA-Proxy version 1.8.4-de425f6 2018/02/26
Copyright 2000-2018 Willy Tarreau willy@haproxy.org

Build options :
TARGET = freebsd
CPU = generic
CC = cc
CFLAGS = -O2 -pipe -fstack-protector -fno-strict-aliasing -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -Wno-address-of-packed-member -Wno-null-dereference -Wno-unused-label -DFREEBSD_PORTS
OPTIONS = USE_GETADDRINFO=1 USE_ZLIB=1 USE_CPU_AFFINITY=1 USE_ACCEPT4=1 USE_REGPARM=1 USE_OPENSSL=1 USE_LUA=1 USE_STATIC_PCRE=1 USE_PCRE_JIT=1

Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Built with network namespace support.
Built with zlib version : 1.2.11
Running on zlib version : 1.2.11
Compression algorithms supported : identity(“identity”), deflate(“deflate”), raw-deflate(“deflate”), gzip(“gzip”)
Built with PCRE version : 8.40 2017-01-11
Running on PCRE version : 8.40 2017-01-11
PCRE library supports JIT : yes
Built with multi-threading support.
Encrypted password support via crypt(3): yes
Built with transparent proxy support using: IP_BINDANY IPV6_BINDANY
Built with Lua version : Lua 5.3.4
Built with OpenSSL version : OpenSSL 1.0.2k-freebsd 26 Jan 2017
Running on OpenSSL version : OpenSSL 1.0.2k-freebsd 26 Jan 2017
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports : SSLv3 TLSv1.0 TLSv1.1 TLSv1.2

Available polling systems :
kqueue : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use kqueue.

Available filters :
[TRACE] trace
[COMP] compression
[SPOE] spoe


#6

I have no clue what you mean by that.

Why do you need to change the default buffers in the first place?


#7

I need save this post data.

core.register_action(“save_backend”, { “http-req” }, function(applet)
local body = applet.f:req_body()
if haproxy_redis(body) then
applet.http:req_add_header(“redis-backend”,‘save’)
end
end)