Welcome! Log In Create A New Profile

Advanced

Re: ngx_lua location capture issue

Nginx User
October 21, 2011 10:02AM
On 21 October 2011 07:13, agentzh <agentzh@gmail.com> wrote:
> BTW, it's bad practice to match against $request_uri directly because
> query strings may be escaped according to URI escaping rules. (Yes!
> there's escaping everywhere!)
That's a great point. ngx.unescape.uri helps get over this.

Better still yet, it is the actual arguments I need to be matching
against and that was just an initial setup thing.

I have since moved on to ....

local args = ngx.req.get_uri_args()
for key, val in pairs(args) do
if type(val) == "table" then
my_arg = table.concat(val, ", ")
else
my_arg = val
end
if my_arg then
local query_string = ngx.re.match(my_arg,
"regex_1", "io")
...
local query_string = ngx.re.match(my_arg,
"regex_n", "io")
...
end
end

The val entities are url unescaped by ngx_lua so no issues with that.

Now that this is all working fine (after using "\\\" in place of the
documented "\\" to get it to actually work - and it does work while
the "correct" version does not), I can get back trying out the
location capture again.

Will let you know how that goes in a new thread since I have derailed
this one with the regex issue.

Cheers!

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

ngx_lua location capture issue

Nginx User October 18, 2011 12:56PM

Re: ngx_lua location capture issue

Nginx User October 18, 2011 01:30PM

Re: ngx_lua location capture issue

Nginx User October 18, 2011 01:30PM

Re: ngx_lua location capture issue

Nginx User October 18, 2011 02:00PM

Re: ngx_lua location capture issue

agentzh October 18, 2011 10:42PM

Re: ngx_lua location capture issue

agentzh October 18, 2011 10:50PM

Re: ngx_lua location capture issue

Nginx User October 19, 2011 12:46PM

Re: ngx_lua location capture issue

agentzh October 18, 2011 10:34PM

Re: ngx_lua location capture issue

agentzh October 19, 2011 05:26AM

Re: ngx_lua location capture issue

Nginx User October 19, 2011 02:12PM

Re: ngx_lua location capture issue

agentzh October 19, 2011 08:44PM

Re: ngx_lua location capture issue

Nginx User October 20, 2011 04:28AM

Re: ngx_lua location capture issue

agentzh October 20, 2011 04:48AM

Re: ngx_lua location capture issue

Nginx User October 20, 2011 06:50AM

Re: ngx_lua location capture issue

agentzh October 20, 2011 07:50AM

Re: ngx_lua location capture issue

Nginx User October 20, 2011 12:04PM

Re: ngx_lua location capture issue

agentzh October 21, 2011 12:10AM

Re: ngx_lua location capture issue

agentzh October 21, 2011 12:14AM

Re: ngx_lua location capture issue

Nginx User October 21, 2011 03:36AM

Re: ngx_lua location capture issue

Nginx User October 21, 2011 03:56AM

Re: ngx_lua location capture issue

Nginx User October 21, 2011 10:02AM

Re: ngx_lua location capture issue

Nginx User October 21, 2011 10:28AM

Re: ngx_lua location capture issue

Nginx User October 21, 2011 10:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 144
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready