lua-resty-limit-traffic
lua-resty-limit-traffic copied to clipboard
ngx.ctx with ssl_certificate_by_lua
Hi, thanks for the great work! One example of the use of ssl_certificate_by_lua_{file,block} is request limiting with this library.
But in the ssl_certificate_by_lua_* code there is no ngx.ctx available, which is used in the examples.
That would be the recommended way to store the limiter, key and delay in the ssl routine?
@phillipp
A SSL handshake (happened with connection level) may be related with multiple HTTP requests. Therefore you can't simply leave
the limit in log_by_lua
even ngx.ctx
is available.
It is possible to limit the request number in ssl_certificate_by_lua, but it is not possible to limit the connection number as there is no way to decrease the counter when the connection is gone.