严格意义上来说你这个SLEEP应该加在filter事件里
------------------ 原始邮件 ------------------
发件人: "ccwwl Wu";<ccw...@gmail.com>;
发送时间: 2015年12月10日(星期四) 晚上9:34
收件人: "openresty"<openresty@googlegroups.com>;
主题: [openresty] Re: 请教各位,有没有什么模块可以做到 nginx 做正向代理时,控制返回 js/css 资源的速率。
搞定了,多谢各位,使用如下配置
location ~* .*\.(css|js)?$ {
access_by_lua 'ngx.sleep(0.1)';
proxy_pass $scheme://$http_host$request_uri;
proxy_set_header Host $http_host;
proxy_cache one;
proxy_connect_timeout 200ms;
proxy_cache_use_stale error timeout;
proxy_read_timeout 1s;
proxy_cache_key $scheme://$host$request_uri;
}
在 2015年12月10日星期四 UTC+8下午5:49:10,ccwwl Wu写道:
用来做模拟延迟的测试,web browser --> nginx --> web server. 希望控制 nginx 返回给 web browser 的时间。谢谢各位。
--