Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107560
  • 博文数量: 38
  • 博客积分: 1520
  • 博客等级: 上尉
  • 技术积分: 325
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-20 11:12
文章分类

全部博文(38)

文章存档

2012年(4)

2011年(1)

2010年(7)

2009年(21)

2008年(1)

2007年(4)

我的朋友

分类: 系统运维

2012-03-01 10:14:37

server
{
  listen       80;
  server_name  ;
  index index.html index.htm index.php;
  root  /data0/htdocs/lamp100;
  #nginx去掉index.php
  location / {
     rewrite ^/$ /index.php last;
     #一下是防止某些文件夹被直接访问
     rewrite ^/(?!index\.php|robots\.txt|uploadedImages|resource|images|js|css|styles|static)(.*)$ /index.php/$1 last;
  }
  #nginx模拟pathinfo,否则CI框架的控制器无法访问
  location ~ ^(.+\.php)(.*)$
  {
    #fastcgi_pass  unix:/tmp/php-cgi.sock;
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_param        SCRIPT_FILENAME        $document_root$fastcgi_script_name;
    fastcgi_param        PATH_INFO                $fastcgi_path_info;
    fastcgi_param        PATH_TRANSLATED        $document_root$fastcgi_path_info;
    include        fastcgi_params;
    #include fcgi.conf;
  }
  log_format  lamp100logs  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
  access_log  /data1/logs/lamp100logs.log  lamp100logs;
}
 
转自:
阅读(920) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~