How to install symfony2 app in a subdirectory in nginx
I need to install multiple symfony2 applications on the same host but on different subdirectories (or location blocks). With this config nginx throws a "file not found" or redirect loop message when trying to access any url. Example: /login -> /base/login /app1 -> /base/app1 /app2 -> /base/app2 Current Config: root /base/default; #Points to an empty directory # Login Application location ^~ /login { alias /base/login/web; try_files $uri app_dev.php; } # Anything else location ~ ^/([\w\-]+) { alias /base/$1/web; try_files $uri app_dev.php; } location / { # Redirect to the login rewrite ^ /login