Using regex captures in handler

Marcus Clyne eugaia at
Tue Mar 10 18:37:41 MSK 2009


I'm writing an Nginx module where I'd like to use the regex and variable 
captures as part of my own directives, e.g.

set    $my_var   my_val;

location   ~ ^/test/(.*)$ {
    my_directive_setting   $my_var.$1;

I know this is easily possible just by using the 'set' directive, but 
there are performance reasons I don't want to do that (sometimes my 
setting can determine things at launch time, which using the 'set' 
directive would need to be done at runtime).

I've been reading through the source code, but haven't yet found which 
functions I need to use to setup (at launch time) and write the 
directive's value (at runtime).

Can anyone tell me what functions I need to use?



More information about the nginx mailing list