Can someone explain nginx conditional flags? (-f, -d, -e, etc)
I'm in the process of migrating from Apache to nginx and have used http://winginx.com/en/htaccess to migrate the rewrite rules. I'm trying to understand what the translated ones mean though and I can't find any documentation on it. Here's an example:
if (-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
I believe -f
checks if a file exists, and -d
checks if a directory exists, but what about -e
? And where might I find these in the documentation? Thank you!
According docs:
- checking of a file existence with the
-f
and!-f
operators; - checking of a directory existence with the
-d
and!-d
operators; - checking of a file, directory, or symbolic link existence with the
-e
and!-e
operators; - checking for an executable file with the
-x
and!-x
operators.