I'm struggling with creating a simple rewrite url on nginx.
My configuration looks like this:
location /foo/bar {
rewrite ^/(.+)$ /index.php?p=$1 break;
}
E.g. /foo/bar/baz should become /foo/bar/index.php?p=baz (internally of course)
However, everything accessed through /foo/bar/ triggers a download of an index.php located at the root. How do I get this to work ?
I've also tried using try_files but can't figure out how to exclude the /foo/bar/ path from $uri.