Open eleshar opened 8 years ago
Hi,
This is a limitation of the ngx lua API. See https://github.com/openresty/lua-nginx-module/issues/566 and https://groups.google.com/forum/#!topic/openresty-en/vhHYcoCmRxA. So any ETA is going to be reliant on upstream :)
As a workaround for now you can disable multipart upload parsing: https://github.com/p0pr0ck5/lua-resty-waf#process_multipart_body. Other functionality like query string args, URL-encoded for request bodies, and response data should be unaffected (let me know otherwise if they are).
I'll leave this ticket as a placeholder until http2 support is available via lua-nginx-module, so we don't get the same requests multiple times. Thanks!
Renaming the title of this issue for clarification.
Noting here for posterity, this links more closely to https://github.com/openresty/lua-resty-upload/issues/24 than other issues note above, as we leverage this library directly.
The issue has been resolved?
Unless lua-resty-upload has started supporting HTTP/2, then no ;)
I use proxy_pass to use lua-resty-upload in http2. :-)
$ curl -F "file=@sample.txt" https://localhost:8443/upload --http2 --insecure
http {
server {
listen 8088;
location /upload {
content_by_lua '
local upload = require "resty.upload"
local cjson = require "cjson"
local chunk_size = 5 -- should be set to 4096 or 8192
-- for real-world settings
local form, err = upload:new(chunk_size)
if not form then
ngx.log(ngx.ERR, "failed to new upload: ", err)
ngx.exit(500)
end
form:set_timeout(1000) -- 1 sec
while true do
local typ, res, err = form:read()
if not typ then
ngx.say("failed to read: ", err)
return
end
ngx.say("read: ", cjson.encode({typ, res}))
if typ == "eof" then
break
end
end
local typ, res, err = form:read()
ngx.say("read: ", cjson.encode({typ, res}))
';
}
}
server {
listen 8443 ssl http2 default_server;
server_name foo.com;
ssl_certificate server.crt;
ssl_certificate_key server.key;
location / {
proxy_pass http://backend;
proxy_request_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
upstream backend {
server localhost:8088;
keepalive 128;
}
}
Hi,
I'm currently running lua-resty waf on openresty-1.9.15.1 in SIMULATE mode - seeing the following error in my logs (Results in Internal Server Error on front-end).
Any ETA on HTTP/2 support?