diff --git a/conf/nginx.conf b/conf/nginx.conf index 9af0994..fd9ceb7 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ worker_processes auto; #nginx worker 数量 -error_log logs/error.log; #指定错误日志文件路径 +error_log /home/frankly/work/AuthPlatform/logs/error.log info; #指定错误日志文件路径 #worker_rlimit_nofile 65535; @@ -8,8 +8,9 @@ events { } http { - client_max_body_size 10k; #允许最大100k的请求体 - client_body_buffer_size 4k; #设置缓冲区大小 + ##lua_need_request_body on; #开启读取请求体数据 + client_max_body_size 1024M; #允许最大100k的请求体 + client_body_buffer_size 1024M; #设置缓冲区大小 lua_package_path '$prefix/src/?/?.lua;$prefix/src/?.lua;/home/frankly/work/AuthPlatform/src/?.lua;/home/frankly/work/AuthPlatform/src/?/?.lua;;'; lua_package_cpath '$prefix/src/share/lib/?.so;;'; diff --git a/src/test/test.lua b/src/test/test.lua index d71db47..b4c399b 100644 --- a/src/test/test.lua +++ b/src/test/test.lua @@ -10,17 +10,23 @@ ngx.req.read_body() --获取请求数据 local body_data = ngx.req.get_body_data() -if not body_data then - ngx.say("read file error:"..err) - return ngx.exit(400) -end +--if not body_data then +-- ngx.say("read file error:", err) +-- return ngx.exit(400) +--end +local len = #body_data -ngx.say(body_data) +--local file_name = ngx.req.get_body_file() +ngx.say("file length:", len) + +--ngx.req.read_body_in_buffer(ngx.var.request_body_file) + +--ngx.say(body_data) --local cjson = require("cjson") --local file_path = "/home/frankly/work/test.dat" ---local file_length = 1024 * 1024 * 380 +--local file_length = 1024 * 1024 * 400 --local f, err = io.input(file_path, "r") --if not f then -- ngx.say("read file error:"..err) @@ -33,5 +39,7 @@ ngx.say(body_data) -- key = "data", -- value = content --} +----ngx.header["Length"] = #content --ngx.header["Content-Type"] = 'application/json; charset=UTF-8' ---ngx.say(cjson.encode(res)) \ No newline at end of file +--ngx.say(cjson.encode(res)) +--ngx.log(ngx.INFO, "send data success") \ No newline at end of file