nginx/openresty
discsthnew
这个作者很懒,什么都没留下…
展开
-
openresty 请求断开问题
有时候,客户端已经断开连接了,但是openresty并未捕获该事件,导致后端请求仍在进行。使用ngx.on_abort() 可以捕获客户端退出事件,在调用自定义函数来进行扫尾工作。先为nginx添加lua_check_client_abort on;(http, server, location) 配置 When lua_check_client_abort is set to o...原创 2018-03-26 10:57:29 · 1398 阅读 · 1 评论 -
lua-resty-http 库的使用心得
git 地址:https://github.com/pintsized/lua-resty-http有个项目,需要用到openresty做代理。代码如下:local reader = res_c.body_readerrepeat local chunk, err = reader(65536) --1m if err then ngx.log(ngx...原创 2018-03-26 10:58:13 · 15084 阅读 · 0 评论 -
nginx log 中文
nginx log 中文原创 2018-03-26 11:07:40 · 1365 阅读 · 1 评论 -
nginx 限速
limit_rateSyntax: limit_rate rate;Default: limit_rate 0;Context: http, server, location,if in location限制单个连接的速度。配置示例:location / { root html; index index.html index.htm; expires ...原创 2019-08-15 11:54:15 · 477 阅读 · 1 评论