ngx_lua location capture issue
agentzh at gmail.com
Thu Oct 20 00:43:46 UTC 2011
On Thu, Oct 20, 2011 at 2:10 AM, Nginx User <nginx at nginxuser.net> wrote:
>> I think I've already fixed this issue in the ngx_lua v0.3.1rc17 release:
>> There was a bug in ngx.exec()'s handling when being used within
>> rewrite_by_lua* and access_by_lua* directives, which could cause
>> hanging in certain extreme conditions.
>> Could you please try it out on your side?
> I'll have a go in due course. I have dumped the config originally
> posted. Will look into reconfiguring along those lines later.
> In the meantime, can you help out with my fallback?
> I have a set of about 70 regexes that are run using access_by_lua_file
> after finding out that access_by_lua has a string length limit
It is the nginx config file parser has a length limit on individual
config directives. Use access_by_lua_file instead to put your Lua code
into an external .lua file and thus eliminating the length constraint
> I have applied the escaping sequences and they generally work but
> these ones generate errors:
> -- 42
> -- original
> local query_string =
A rule of thumb is that "\" should become "\\\\" (four back-slashes!)
while using access_by_lua and "\\" (two back-slashes!) while using
access_by_lua_file. You're writing things like "\\\s" (three
back-slashes!), which is weird.
Why not put your Lua code into an external .lua file and use
access_by_lua_file or rewrite_by_lua_file instead? That way you only
need to escape each "\" only once.
More information about the nginx