Passing variables to perl modules in nginx.conf:

Hello,

Is it possible to pass variables to embedded perl modules via
nginx.conf and if so how would that be done? For instance(approx):

http {
perl_modules perl/lib;
perl_require My::super_task.pm;
}

Server{
location @important_task{

            perl My::super_task "A";
    }

}

-Thanks

/e

On 1/26/12, Engin A. [email protected] wrote:

Is it possible to pass variables to embedded perl modules via
nginx.conf and if so how would that be done?

set $foo "bar";
perl My::super_task "A";

In perl:

sub handler {
    my $r = shift;
    my $foo = $r->variable('foo');
    ...
}

Awesome! That worked.

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