Closed fommil closed 7 years ago
ok, this seems to be working for me
location / {
echo_sleep 0.1;
echo_exec @raw;
}
location @raw {
root /to/my/data;
}
so I change my question to... is this how I'm supposed to do it?
@fommil Both echo_sleep
and root
register a different "content handler" for that location. And in nginx, only one content handler is allowed in a single location. Use of ngx_echo
's own directives work since they register the same single content handler of ngx_echo
. This is nginx basics. To work around that, you should use the ngx_lua module instead, as in
location / {
access_by_lua_block { ngx.sleep(0.1) }
root /to/my/data;
}
Hi, I'm trying to use
echo_sleep
as a way to mock out some services with known worst case latency. My docker build is here https://github.com/fommil/docker-nginx-echo which seems to work fine.However, this kind of config always returns empty contents
(obvs works without the
echo_sleep
, but no delay). I tried a hack ofbut also not doing what I expect. Is there a way to just get the
echo_sleep
feature?