用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2023|回复: 4
收起左侧

[HELP] 求助 nginx环境下怎么配 pathinfo ??

[复制链接]
发表于 2014-8-14 16:30:47 | 显示全部楼层 |阅读模式
PHP复制代码
location ~ \.php$ {            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
           #fastcgi_param  SCRIPT_FILENAME  /data/www/yixue.vfocus.cn/$fastcgi_script_name;
          #include        fastcgi_params;

 
            ##########################################pathinfo 模式
           set $path_info "";
            set $real_script_name $fastcgi_script_name;
            if ($fastcgi_script_name ~ "^(.+?\\.php)(/.+)$"){
                 set $real_script_name $1;
                 set $path_info $2;
            }
            #include fastcgi_params;
           fastcgi_param  SCRIPT_FILENAME  /data/www/yixue.vfocus.cn/$real_script_name;
            #fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
           fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
            include fastcgi_params;
            ##########################################nginx支持pathinfo 模式的重点
       }
复制代码


上面是 conf配置 为什么不行啊?求教
 楼主| 发表于 2014-8-14 16:44:29 | 显示全部楼层
木有人知道吗?
发表于 2014-8-16 16:33:52 | 显示全部楼层
user  www www;

worker_processes 8;

error_log  /data1/logs/nginx_error.log  crit;

pid        /usr/local/webserver/nginx/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 65535;

events
{
  use epoll;
  worker_connections 65535;
}

http
{
  include       mime.types;
  default_type  application/octet-stream;

  #charset  gb2312;
      
  server_names_hash_bucket_size 128;
  client_header_buffer_size 32k;
  large_client_header_buffers 4 32k;
  client_max_body_size 8m;
      
  sendfile on;
  tcp_nopush     on;

  keepalive_timeout 60;

  tcp_nodelay on;

  fastcgi_connect_timeout 300;
  fastcgi_send_timeout 300;
  fastcgi_read_timeout 300;
  fastcgi_buffer_size 64k;
  fastcgi_buffers 4 64k;
  fastcgi_busy_buffers_size 128k;
  fastcgi_temp_file_write_size 128k;

  gzip on;
  gzip_min_length  1k;
  gzip_buffers     4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  gzip_types       text/plain application/x-javascript text/css application/xml;
  gzip_vary on;

  #limit_zone  crawler  $binary_remote_addr  10m;

  server
  {
    listen       80;
    server_name  hudong.com;
    index index.html index.htm index.php;
    root  /data0/htdocs/blog;

    #limit_conn   crawler  20;   
location / {
                if ( !-e $request_filename) {
                        rewrite ^/(.*)$ /index.php?$1 last;
                }
        }
                             
    location ~ .*\.(php|php5)?$
    {      
      #fastcgi_pass  unix:/tmp/php-cgi.sock;
      fastcgi_pass  127.0.0.1:9000;
      fastcgi_index index.php;
      include fcgi.conf;
    }
   
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
      expires      30d;
    }

    location ~ .*\.(js|css)?$
    {
      expires      1h;
    }   


    log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
              '$status $body_bytes_sent "$http_referer" '
              '"$http_user_agent" $http_x_forwarded_for';
    access_log  /data1/logs/access.log  access;
      }
  }
}
发表于 2015-3-6 22:10:15 | 显示全部楼层
其实没那么复杂,上nginx官网搜codeigniter字眼解决。
发表于 2015-4-1 23:55:19 | 显示全部楼层
raynor1984 发表于 2015-3-6 22:10
其实没那么复杂,上nginx官网搜codeigniter字眼解决。

我按照它官网还是不行提示:File not found.

本版积分规则