相思资源网 Design By www.200059.com

Symfony
Symfony国外很流行的php框架,目前国内用的相对较少,但是一定会在国内火起来. nginx重写规则如下

server {
 server_name jb51.net www.jb51.net;
 root /data/site/www.jb51.net;
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.jb51.net_error.log;
 }

 
重启nginx即可

CodeIgniter
CodeIgniter,即被很多人简称为CI的高人气PHP框架,其中文社区也比较活跃,来看一下CI的rewrite写法:

server {
 listen 80;
 server_name jb51.net www.jb51.net;
root /data/site/www.jb51.net;
 index index.php;
 error_log log/error.log;
# set expiration of assets to MAX for caching
 location ~* .(ico|css|js|gif|jpe"htmlcode">
$config['base_url'] = "https://www.jb51.net/";
 $config['index_page'] = "";
 $config['uri_protocol'] = "REQUEST_URI";

标签:
Symfony,CodeIgniter,Nginx,配置,Nginx配置

相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com

评论“PHP的Symfony和CodeIgniter框架的Nginx重写规则配置”

暂无PHP的Symfony和CodeIgniter框架的Nginx重写规则配置的评论...