Reading from variable in config file

Roman Mobczynski lists at ruby-forum.com
Wed May 6 18:07:25 MSD 2009


Hi all,
I need to read client's IP to store it in module context:

{ ngx_string("real_ip"),
        NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
        ngx_conf_set_str_slot,
        NGX_HTTP_LOC_CONF_OFFSET,
        offsetof(ngx_http_my_loc_conf_t, realIp),
        NULL },

and in config file:
real_ip $proxy_add_x_forwarded_for;

but then it stores not value, but value's name
($proxy_add_x_forwarded_for). This line is put in the same location
where

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

is, which works fine, so client's ip must be there :)

Or there is mayby another way to get $proxy_add_x_forwarded_for from
inside of my module?

thanks in advance,
mobczynski
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list