Forum: NGINX Making rewrite a non-static function

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
535e2bd84829abaf90def03e89299e20?d=identicon&s=25 Marcus Clyne (Guest)
on 2009-03-18 23:00
(Received via mailing list)
Hi,

Is there an easy way to set a variable that uses captures from within
another module?

I'm trying to set my own variable that as part of the setup, creates a
variable that may or may not use a variable (depending on the setting).
Rather than using the 'set' directive, I would like to create my own
directive to determine whether I need a variable or not.  However, if I
do, I would like to be able to use all the functionality of other
variables.

The easiest way I see for doing this, would be to call the
ngx_http_rewrite_set from my own module, if needs be, but it is
currently a static function.

If it is not currently possible, Igor, could you possible make
ngx_http_rewrite_set (and possibly other modular functions that might be
useful) a non-static var and add it to one of the headers files (e.g.
ngx_http.h)?  Alternatively, how about adding a public function to make
it easy for developers to add variables that use captures from within
their modules and making that a public function instead of the default
configuration one?  I'm happy to write this function if you'd include it
in the source.  I would have thought it would only need to be a few
lines.

Thanks,

Marcus.
This topic is locked and can not be replied to.