nginx重写规则codeigniter

i am using Winginx for using nginx php and mysql on windows. i want run and config CodeIgniter 2.

Winginx structure:

d:\winginx|
    nginx.exe
    php5\php.exe
    mysql\mysqld.exe
    \home\localhost\public_html\codeigniter

base this (http://wiki.nginx.org/Codeigniter)

and this (http://www.farinspace.com/codeigniter-nginx-rewrite-rules/)

and this (Nginx rewrite rule for CodeIgniter)

i try coonfig ci but i just see codeigniter 404 page (no nginx 404 page)

my ci config.php is

$config['base_url'] = "";
$config['index_page']   = "";
$config['uri_protocol'] = "AUTO";
..

nginx.config is

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

pid        temp/nginx.pid;


events {
    worker_connections  1024;
}


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

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    client_max_body_size 55m;

    #gzip  on;

    scgi_temp_path  temp/uwsgi_temp 1 2;
    uwsgi_temp_path  temp/uwsgi_temp 1 2;

    fastcgi_connect_timeout 1;

    include codeigniter.conf;
}

i include codeigniter.conf in nginx.conf codeigniter.conf is:

server {
        listen       80;
        server_name localhost;
        root home/localhost/public_html/codeigniter:
        autoindex on;
        index index.php;

        location / {

            try_files $uri $uri/ /index.php?/$request_uri;

            location = /index.php{

                fastcgi_pass localhost:9000;
                #fastcgi_split_path_info       ^(.+\.php)(.*)$;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                #fastcgi_param PATH_INFO       $fastcgi_path_info;
                include fastcgi_params;
            }
        }

        location ~ \.php$ {
            return 444;
        }


}

i try 3 different coonfig ci but i just see codeigniter 404 page (no nginx 404 page).

http://localhost/codeigniter/welcome/index -> CI 404 page!
http://localhost/codeigniter/welcome -> CI 404 page!
http://localhost/codeigniter -> CI 404 page!

i guest the problem is created by the php file location in codeigniter.conf

please help me to config it !

I'd try this

server {
    listen       80;
    server_name localhost;
    root home/localhost/public_html/codeigniter;
    autoindex on;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php;
    }

    location = /index.php {
        fastcgi_pass localhost:9000;
        #fastcgi_split_path_info       ^(.+\.php)(.*)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #fastcgi_param PATH_INFO       $fastcgi_path_info;
        include fastcgi_params;
    }

    location ~ \.php$ {
        return 444;
    }
}

Here's what I use for a production CI install

server
{
    listen 80 default_server;
    server_name www.site.com;

    root /var/www;
    index index.php;

    # canonicalize codeigniter url end points
    location ~ ^/index.php/(.*[^/])$ { return 301 $scheme://$host/$1/$is_args$args; }
    location ~ ^/index.php/(.*)/$ { return 301 $scheme://$host/$1/$is_args$args; }

    location / {
        # Check if a file or directory index file exists, else route it to index.php.
        try_files $uri $uri/ /index.php;
    }



    location ~ \.php$
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

I got it working the following way...

server {
        listen 127.0.0.1:80;
        server_name  xxxx www.xxxx;
        root home/xxxx/public_html;
        autoindex on;
        index index.php;

        location / {

            try_files $uri $uri/ /index.php?/$request_uri;

            location ~ \.php$ {
                if (!-e $document_root$document_uri){
                    return 404;
                }
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
            }

        }

        location ~ \.php$ {
            return 444;
        }
}