Symfony国外很流行的php框架,目前国内用的相对较少,但是一定会在国内火起来.?nginx重写规则如下
server { server_name?ttlsa.com?www.ttlsa.com; root /data/site/www.ttlsa.com;location / { # try to serve file directly, fallback to rewrite try_files $uri @rewriteapp; }location @rewriteapp { # rewrite all to app.php rewrite ^(.*)$ /app.php/$1 last; }location ~ ^/(app|app_dev|config).php(/|$) { fastcgi_pass unix:/var/run/php5-fpm.sock; #?改成你对应的FastCGI fastcgi_split_path_info ^(.+.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; }error_log /data/logs/nginx/www.ttlsa.com_error.log; }
重启nginx即可
原文地址:Symfony nginx重写规则, 感谢原作者分享。 与其临渊羡鱼,不如退而结网。