add variable in module, change value in config

artemg nginx-forum at nginx.us
Wed Oct 26 15:36:00 UTC 2011


I want to control behaviour of my module at runtime(body filtering
phase), depending on different data (reg exp in headers, value of
different variables...), so I decided to add variable in my module, and
then set value in nginx config with "set" operation in rewrite module. 
I am adding variable via ngx_http_add_variable() in pre-config, set
set_handler, and when I am doing "set $my_variable "0" " in nginx
config, I get "duplicate variable my_variable" on nginx start up. 
What I am doing wrong? May be I need to set variable by set, and In my
module get index, and then get value of variable?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,217375,217375#msg-217375



More information about the nginx mailing list