码迷,mamicode.com
首页 > 其他好文 > 详细

CodeIgniter框架——nginx下的配置

时间:2014-08-20 22:34:23      阅读:305      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   os   io   strong   

odeigniter(CI)是一个轻量型的PHP优秀框架,但是它是在apache服务器下开发的,在nginx下需要特别的配置才可以使用。

对nginx的配置如下:

bubuko.com,布布扣

 

 1 server {
 2     listen 80 default_server;
 3     listen [::]:80 default_server ipv6only=on;
 4 
 5     root /home/mqx/openflow/openflow/openflow/web;
 6     index index.html index.htm index.php;
 7 
 8     server_name localhost;
 9 
10     location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
11         expires max;
12         log_not_found off;
13     }
14 
15 
16     location / {
17         try_files $uri $uri/ /index.php;
18         #try_files $uri $uri/ =404;
19     }
20 
21     error_page 500 502 503 504 /50x.html;
22     location = /50x.html {
23         root /usr/share/nginx/html;
24     }
25 
26     location ~ \.php$
27     {
28 
29       fastcgi_pass 127.0.0.1:9000;
30         fastcgi_index index.php;
31         fastcgi_param   PATH_INFO      $fastcgi_path_info;
32         fastcgi_param    SCRIPT_FILENAME    /home/mqx/openflow/openflow/openflow/web$fastcgi_script_name;
33         fastcgi_param    PATH_TRANSLATED    /home/mqx/openflow/openflow/openflow/web$fastcgi_path_info;
34         include fastcgi_params;
35     }
36 
37     location ~ /\.ht {
38         deny all;
39     }
40 }

 

几个不错的配置博文:

codeigniter在nginx安装配置及URL重写

nginx配置CI框架的完整版

nginx下codeigniter框架的rewrite规则

CodeIgniter框架——nginx下的配置,布布扣,bubuko.com

CodeIgniter框架——nginx下的配置

标签:style   blog   http   color   使用   os   io   strong   

原文地址:http://www.cnblogs.com/xymqx/p/3925587.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!