I am using nginx 1.8 and knowing about the alias/try_files bug i wrote the following nginx conf:
root /var/www/
location /foo/ {
root /var/www/projects/bar/public/;
try_files $uri $uri/ index.php;
}
in which i get a 404, but if i write the following way (which should point to the same location)
root /var/www/
location ~ ^/foo/(.*)$ {
try_files /projects/bar/public/$uri /projects/bar/public/$uri/ /projects/bar/public/index.php;
}
i get the contents. Why the other root seems not to be applyied?