I upgraded my nginx server from 0.7.x to 1.0.2 and I copied the old configuration file for the new nginx server. Everything worked fine, except for the if-directive. I had the following block of code in the old config file which doesn't seem to be working with the latest nginx version.
location /myapp {
if (!-e $request_filename) {
rewrite ^/myapp/(.*)$ /myapp/index.php?q=$1 last;
break;
}
root /var/www;
index index.php index.html index.htm;
}
Any idea what's wrong?
P.S.: Yes I know IfIsEvil and I did try exploring try_files, but I couldn't figure out how to pass only the part of the URI AFTER myapp/ as against passing the enter URI to index.php like so: try_files $uri index.php?q=$uri
You want to redirect all requests to a common front controller.