本帖最后由 yxqc 于 2013-10-07 11:58:51 编辑  
 我的nginx.conf如下:  #user  nobody;worker_processes  1;error_log  logs/error.log;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;#pid        logs/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;    #gzip  on;    server {        listen       8088;        server_name  localhost;        #charset koi8-r;        #access_log  logs/host.access.log  main;        location / {            root   d:/cwsserv/www;            index  index.php index.html index.htm ;        }        #error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the php scripts to apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the php scripts to fastcgi server listening on 127.0.0.1:9000        #        location ~ \.php {            root           d:/cwsserv/www;            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  script_filename  d:/cwsserv/www$fastcgi_script_name;            include        fastcgi_params;						#pathinfo support             set $real_script_name $fastcgi_script_name;             set $path_info ;             if ($fastcgi_script_name ~ ^(.+?\.php)(/.+)$)			{                 set $real_script_name $1;                 set $path_info $2;             }               fastcgi_param script_name $real_script_name;             fastcgi_param path_info $path_info;         }        # deny access to .htaccess files, if apache's document root        # concurs with nginx's one        #        #location ~ /\.ht {        #    deny  all;        #}    }    # another virtual host using mix of ip-, name-, and port-based configuration    #    #server {    #    listen       8000;    #    listen       somename:8080;    #    server_name  somename  alias  another.alias;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}    # https server    #    #server {    #    listen       443;    #    server_name  localhost;    #    ssl                  on;    #    ssl_certificate      cert.pem;    #    ssl_certificate_key  cert.key;    #    ssl_session_timeout  5m;    #    ssl_protocols  sslv2 sslv3 tlsv1;    #    ssl_ciphers  high:!anull:!md5;    #    ssl_prefer_server_ciphers   on;    #    location / {    #        root   html;    #        index  index.html index.htm;    #    }    #}}
回复讨论(解决方案)   http://wiki.nginx.org/httprewritemodule
nginx的文档写得很全面了 
   http://wiki.nginx.org/httprewritemodule
nginx的文档写得很全面了
不知我的nginx.conf要怎么修改??? 
   有人知道不? 
   编译时不指定--without-http_rewrite_module默认就是开启的。
使用rewrite指令来完成url重写,rewrite指令只适用于server、location和if域中,其它域中不支持。
例子:
server{  
         listen       80;  
         server_name test.angryfrog.com;  
         root /users/angryfrog/website/test;  
         index index.php;
if (!-f $request_filename){  
             rewrite ^/(.+)$ /index.php?$1& last;  
         }  
 }
此站点下请求的如果请求的文件不存在,则将会重定向到根目录下得index.php文件,并将请求的内容作为参数传给index.php文件。 
   参考文章: nginx url重写-rewrite实例  
 nginx rewrite(nginx url地址重写)的配置示例  
 超详细的 nginx url重写实例讲解
   
 
   