Welcome! Log In Create A New Profile

Advanced

nginx 1.0.10 error [emerg] invalid condition "'!-f"

July 12, 2012 03:09AM
I have that kind of code which I wanna add to my nginx conf but unfortunately something is wrong and I don't know how to fix it...

location ^~ /folder/ {
if ($cookie_amember_nr !~* [a-zA-Z0-9]+) { #no identity
rewrite ^(.*)$ http://localhost/am3/plugins/protect/new_rewrite/login.php?v=-2,1&url=$request_uri?$args redirect;
}
set $file1 $document_root/am3/data/new_rewrite/$cookie_amember_nr-1;
set $file2 $document_root/am3/data/new_rewrite/$cookie_amember_nr-2;

if (!-f $file1 && !-f $file2) { #has not access
rewrite ^(.*)$ http://localhost/am3/plugins/protect/new_rewrite/login.php?v=-2,1&url=$request_uri?$args redirect;
}

}


and I've got an error in line with : if (!-f $file1 && !-f $file2) { #has not access

error : "[emerg] invalid condition "'!-f"

how to fix this ?

thank you for help
Subject Author Posted

nginx 1.0.10 error [emerg] invalid condition "'!-f"

google000 July 12, 2012 03:09AM

Re: nginx 1.0.10 error [emerg] invalid condition "'!-f"

Maxim Dounin July 12, 2012 03:16AM

Re: nginx 1.0.10 error [emerg] invalid condition "'!-f"

google000 July 15, 2012 08:51AM

Re: nginx 1.0.10 error [emerg] invalid condition "'!-f"

google000 July 15, 2012 09:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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