Retrieving raw nginx location string

36 views
Skip to first unread message

Gavin Woods

unread,
Dec 2, 2022, 5:29:51 AM12/2/22
to openresty-en
Is it possible to get the raw location string in a block?

location ~ "/test/(.+)/world" {
             access_by_lua_block {
                ngx.say(ngx.var.uri)
            }
        }

I basically want to store: /test/(.+)/world as a var with the regex string pattern

ngx.var.uri will log something like /test/1/world which isn't useful for traceability. 
Reply all
Reply to author
Forward
0 new messages