nginx配置Symfony

server {
    listen       80;
    server_name  blog.phpfs.com;
    root   /data/web;
    rewrite ^/app\.php/?(.*)$ /$1 permanent;
    location / {
        index app.php;
        try_files $uri @rewriteapp;
    }
    location @rewriteapp {
        rewrite ^(.*)$ /app.php/$1 last;
    }
    index  index.html index.htm index.php app.php;
    location ~ \.php {
        fastcgi_pass unix:/dev/shm/php5-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
    location ~ /\.ht {
        deny  all;
    }
}

 



Bookmark the permalink.

Comments are closed.