码迷,mamicode.com
首页 > 其他好文 > 详细

CI框架下nginx重写规则

时间:2014-07-29 17:38:52      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   for   html   div   

因为:

 server
 {
    listen       80;
    server_name  222.73.130.124;
    location / {
        index index.html index.htm index.php;
        root  /data0/htdocs/www;
        if (!-e $request_filename) {
            rewrite "^/(.*)$" /index.php last;//这一条很重要
        }
        rewrite ^/$/index.php last;
     }
     location ~ .*\.(php|php5)?$
     {
       root  /data0/htdocs/www;
       fastcgi_pass  127.0.0.1:9000;
       fastcgi_index index.php;
       fastcgi_split_path_info ^(.+\.php)(.*)$;
       fastcgi_param   PATH_INFO      $fastcgi_path_info;//这一条很重要
       fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;
       fastcgi_param    PATH_TRANSLATED    $document_root$fastcgi_path_info;
       include fcgi.conf;
    }
    log_format  wwwlogs  $remote_addr - $remote_user [$time_local] "$request" 
               $status $body_bytes_sent "$http_referer" 
               "$http_user_agent" $http_x_forwarded_for;
    access_log  /data1/logs/wwwlogs.log  wwwlogs;
  }

完成。

CI框架下nginx重写规则,布布扣,bubuko.com

CI框架下nginx重写规则

标签:style   blog   http   color   io   for   html   div   

原文地址:http://www.cnblogs.com/zl0372/p/nginx_php_11.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!