I have a problem with my nginx configuration.
On most of pages and google search entries i found things like "nginx and symfony2" or "nginx and symfony2 in subdirectory". But i not find some thing about this configuration:
- Normal php file projects (path like localhost/project -> /srv/www/project/index.php / ruled per index)
- Symfony2 projects (path like localhost/symfony2 -> /srv/www/symfony2/web/app.php (default) and manually app_dev.php / unknown!?)
Current configuration
server
{
listen 80;
listen [::]:80 default_server ipv6only=on;
root /srv/www;
index index.php index.html index.htm app.php app_dev.php;
try_files $uri $uri/ index.php @rewriteapp /index.php;
server_name localhost;
location ~ ^\/symfony2
{
#rewrite ^\/symfony2(.*)$ /symfony2/web$1 last;
#root /srv/www/symfony2/web;
alias /srv/www/symfony2/web;
}
location @rewriteapp
{
rewrite ^(.*)$ /app.php/$1 last;
}
location ~ \.php(/|$)
{
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Thank's in advance for each tip!