Nginx + embedded perl, sharing variables across workers

yuri nginx-forum at
Thu Apr 7 01:28:51 MSD 2011


I have written a perl handler that generates a random value and needs to
maintain the same value consistently across all other perl handlers (as
there is 1 perl handler per nginx worker) until the workers are

I've attempted to do so by issuing $r->variable('varname', $rand) to no
avail - is it impossible to set a variable defined in nginx.conf and
have the new setting affect any further reads of that variable from
other workers?
Which options do I have if I'd like to share $varname across multiple
perl handlers?


Posted at Nginx Forum:,188905,188905#msg-188905

More information about the nginx mailing list