终于配置好了,记下,以后万一用到呢

server {       
	listen   80;       
	server_name www.iw3c.com;       
	rewrite ^(.*) http://iw3c.com$1 permanent;   
} 
server {       
	listen   80;       
	server_name iw3c.com;       
	# root directive should be global       
	root   /var/www/iw3c.com/public/app/webroot/;       
	access_log /var/www/iw3c.com/log/access.log;       
	error_log /var/www/iw3c.com/log/error.log;       
	location / {           
		index  index.php index.html index.htm;           
		try_files $uri $uri/ /index.php?$uri&$args;       
	}       
	location ~ .php$ {           
		include /etc/nginx/fcgi.conf;           
		fastcgi_pass    127.0.0.1:10005;           
		fastcgi_index   index.php;           
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;       
	}   
}