最新消息:

CakePHP nginx rewrite 规则

nginx admin 3421浏览 0评论
server {
 listen 80;
 server_name www.aikaiyuan.com;
root /data/site/www.aikaiyuan.com;
 index index.php;
access_log /logs/www.aikaiyuan.com_accerss.log;
 error_log /logs/www.aikaiyuan.com_error.log;
# main cakephp rewrite rule
 location / {
 try_files $uri $uri/ /index.php?$uri&$args;
 }
location ~ .php$ {
 root /data/www.aikaiyuan.com;
 try_files $uri =404;
 fastcgi_pass unix:/tmp/php5-fpm.sock;
# 改成你对应的FastCGI
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 fastcgi_buffer_size 128k;
 fastcgi_buffers 256 4k;
 fastcgi_busy_buffers_size 256k;
 fastcgi_temp_file_write_size 256k;
 }
}

转载请注明:爱开源 » CakePHP nginx rewrite 规则

您必须 登录 才能发表评论!