+ -
当前位置:首页 → 问答吧 → 熟悉Ngnix配置的高手请进

熟悉Ngnix配置的高手请进

时间:2011-05-08

来源:互联网

大家好:
  最近我遇到一个问题,我的网站地址:
  http://127.0.0.1:99/general/document/index.php/send/draft,其它未含index.php这样的网址
用apache服务器可以正确打开,但用Ngnix就无法打开,
前台显示:404 Not Found
后台日志显示:
304 CreateFile() "d:/myoa/webroot/general/document/index.php/send/draft" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: localhost, request: "GET /general/document/index.php/send/draft HTTP/1.1", host: "127.0.0.1:99", referrer: "http://127.0.0.1:99/general/"

304 CreateFile() "d:/myoa/webroot/404.html" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: localhost, request: "GET /general/document/index.php/send/draft HTTP/1.1", host: "127.0.0.1:99", referrer: "http://127.0.0.1:99/general/"

我的系统是windows server2003,以下是我的Nignix配置:
HTML code


worker_processes  1;

events {
    worker_connections  1024;
}


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

    keepalive_timeout  60;
    fastcgi_connect_timeout 60;             
    fastcgi_send_timeout 180;  
    fastcgi_read_timeout 180;  
    fastcgi_buffer_size 128k;  
    fastcgi_buffers 4 128k;

    server {
        listen       99;
        server_name  localhost;

        charset gbk;

        location / {
            root   d:/myoa/webroot;
            index  index.php index.html index.htm;
        }
        error_page  404 /404.html;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
       
        location ~* \.(php|php5)$ {
            root           d:/myoa/webroot;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  d:/myoa/webroot$fastcgi_script_name;
            include        fastcgi_params;
        }


望高手能指点一个,谢过!

作者: baronyang   发布时间: 2011-05-08

http://127.0.0.1:99/general/document/index.php/send/draft
这个请求应该由apache来处理吧,你的配置规则并没有将这样的请求交给apache来处理。你的配置规则只是将.php结尾的请求交由apache处理。

试试这个吧
location ~* (\.(php|php5)$|/index.php/) { }


作者: icy_csdn   发布时间: 2011-05-10