Welcome! Log In Create A New Profile

Advanced

Fwd: Re: comparing two variables

June 13, 2011 11:22PM
thanks a lot, thats a really smart idea and it works.

i'm thinking if i should maybe write a module which is simply
uppercasing or lowercasing a variable, so that i don't need this
workaround anymore. do you think there would be other people happy
about having that? via google i haven't found any existing module to
do that.

anyway for now i'm going to deploy the workaround.

thanks



On Tue, Jun 14, 2011 at 04:12, Maxim Dounin <mdounin@mdounin.ru> wrote:
> Hello!
>
> On Mon, Jun 13, 2011 at 03:44:42PM +0800, Mauro Stettler wrote:
>
>> 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?
>
> Yes, regexps must be static. You may try something like this as a
> workaround:
>
> set $tmp "$var1:$var2";
> if ($tmp ~* "^(.*):\1$") {
> ...
> }
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

_______________________________________________
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: 172
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