Skip to content

mike96265/resty-upload-rate-limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

resty-upload-rate-limit

this repo keeps a minimum openresty configuration and some lua code, show you how to limit upload rate.

setup

foo@bar> git clone https://github.com/luvjoey1996/resty-upload-rate-limit.git
foo@bar> cd resty-upload-rate-limit
foo@bar> mkdir logs
foo@bar> openresty -p `pwd` -c nginx.conf

test

foo@bar> curl 127.0.0.1:8888 -T {some file}

main code

-- iter req body, limit upload speed in 200kb/s
for chunk in limit_recv_body(200) do
    ngx.req.append_body(chunk)
end

demo

截图_2020-08-03_23-37-17.png

About

Limit file upload rate in openresty

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages