在nginx配置cakephp实现伪静态

aries 发表于 2013-09-17 5410 次浏览 标签 : lnmpnginxcakephp伪静态重写

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

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;       
	}   
} 

0条评论

如需评论,请填写表单。
换一个

记住我的信息