Using regex captures in handler


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?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs