Welcome! Log In Create A New Profile

Advanced

comparing two variables

June 13, 2011 03:46AM
hi

i wrote a module which is extracting certain values out of a session
that is stored in memcache and stores it into a variable in my nginx
config. so this seems to work fine so far.

now i'm trying to compare $uri with one of these variables and do a
rewrite accordingly. but it seems that the if that comes from nginx'
rewrite module cannot only compare a variable with a static string or
a static regex, but not with another variable.

is that true?

i've tried following and except this if everything works:

---------------------

// get session from memcache
eval $session {
set $memc_key $cookie_session_id;
memc_pass session_memcache;
}

// extract username from session
php_session_parse $user $session
"symfony/user/sfUser/attributes|s:10:\"subscriber\";s:11:\"getNickname\"";

// strip the formatting of the value, so that f.e. s:6:"drevil"
becomes drevil
php_session_strip_formatting $stripped_user $user;

// show all profile data
if ($stripped_user ~* $uri)
{
rewrite . d41d8cd98f00b204e9800998ecf8427e:profile_prod$uri:full last;
}

// show public profile
rewrite . d41d8cd98f00b204e9800998ecf8427e:profile_prod$uri last;

---------------------

i would be thankful for any idea how to implement this condition

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

comparing two variables

replay June 13, 2011 03:46AM

Re: comparing two variables

replay June 13, 2011 04:01AM

Re: comparing two variables

Maxim Dounin June 13, 2011 04:14PM

Fwd: Re: comparing two variables

Mauro Stettler June 13, 2011 11:22PM

Re: Fwd: Re: comparing two variables

TPFreak May 08, 2015 05:27PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
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