hdstu 发表于 2014-2-10 12:23:49

求助nginx配置问题

我现在在测试LOGA 日志系统 他们需要配置下nginx 他们的配置说明是这样

#PHP部分:
location ~ \.php {
    # 以下两行为避免,*.php文件不存在,而PHP-FPM(PHP FastCGI) 返回No input file specified错误,直接指向站点根目录下的404.html
    try_files $uri /www/lib/404/404.error.html;
    fastcgi_intercept_errors off;
    fastcgi_pass    127.0.0.1:9999;
    fastcgi_index    index.php;
    fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    include            fastcgi_params;

    # 以下是为了让Nginx支持PATH_INFO
    set $path_info "";
    set $real_script_name $fastcgi_script_name;
    if($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
      set $real_script_name $1;
      set $path_info $2;
    }
    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
    fastcgi_param SCRIPT_NAME $real_script_name;
    fastcgi_param PATH_INFO $path_info;

    fastcgi_connect_timeout    120;
    fastcgi_send_timeout    120;
    fastcgi_read_timeout    120;
    fastcgi_buffers            8 128K;
    fastcgi_buffer_size      128K;
}


#站点部分:
server {
    listen            80;
    server_name      asthis.net;
    root            /www/root/uwa;
    charset            UTF-8;

    location / {
      if(!-e $request_filename){
            rewrite ^/(.*)$ /index.php/$1 last;
      }
      index    index.php;
    }
    include      php;
    include      error;
}



请高手给写个lnmp环境下的配置文件 谢谢。。

licess 发表于 2014-2-10 14:00:12

支持pathinfo早就说过了,提问前先搜索
https://bbs.vpser.net/viewthread.php?tid=10068&page=1&fromuid=3#pid29934
页: [1]
查看完整版本: 求助nginx配置问题