Openresty ngx.re.find cannot uniquely match

< H2 > describe my problem < / H2 >

system: debian 8.0x64
server: Openresty 1.13.6.1 default installation
novice, the question is relatively simple, I beg your pardon

problem description:
I need to implement a unique match on request_uri (request path) / admin/xxx , so I chose ngx.re.find Syntax:

if (string.find(ngx.var.request_uri, "^/admin/") ~= nil) then
    return ngx.exit(ngx.HTTP_CLOSE)
end

then I found that there was no problem with the match, which shows that the confirmation is not my fault elsewhere.

Menu