Welcome! Log In Create A New Profile

Advanced

Reading from variable in config file

Roman Mobczynski
May 06, 2009 10:07AM
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/.
Subject Author Posted

Reading from variable in config file

Roman Mobczynski May 06, 2009 10:07AM

Re: Reading from variable in config file

Roman Mobczynski May 13, 2009 08:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready