ngnix 配置CI框架 与 CI的简单使用
ngnix 支持 CI框架
1、修改config.php
参考网址:https://www.chenyudong.com/archives/codeigniter-in-nginx-and-url-rewrite.html
2、 ci小样例
http://www.mamicode.com/info-detail-514033.html
控制器的默认配置文件: routes.php, 不修改默认为跳转到welcome控制器
3、修改CI为子目录
https://yq.aliyun.com/articles/44948
我的ngnix.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 { autoindex on;# 显示目录
autoindex_exact_size on;# 显示文件大小
autoindex_localtime on;# 显示文件时间
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 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root D:/wnmp/www;
#root D:/wnmp/www/framework/CodeIgniter-3.1.0;
index index.html index.htm index.php; try_files $uri $uri/ /index.php?$query_string;
} location /CI/ {
root D:/wnmp/www;
index index.html index.htm index.php; try_files $uri $uri/ /index.php?$query_string; }
location /CI/index.php { root D:/wnmp/www; fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} #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:/wnmp/www;
#root D:/wnmp/www/framework/CodeIgniter-3.1.0; fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} # 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 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
ngnix 配置CI框架 与 CI的简单使用的更多相关文章
- 三、CI框架之一个最简单的页面
一.在CI框架里面的controllers <?php defined('BASEPATH') OR exit('No direct script access allowed'); class ...
- CI框架入门中的简单MVC样例
最简单的CI模型: 注意:模型须要用到数据库 配置文件在appcation/config.php 这里我们要用到数据库,须要将databases.php中的 相关參数填写一下,详细不再赘述. 直接进入 ...
- 【CI3.1】CI框架简单使用方法
CI框架简单使用方法 1.回忆MVC 1.1.M:模型,提供数据,保存数据 1.2.V:视图,只负责显示,表单form 1.3.C:控制器,协调模型和视图 1.4.action:动作,是控制器中的方法 ...
- 【转】最简单的CI框架入门示例--数据库取数据
1.下载CI框架(自己找) 2.配置 database.php配置: 为数据库服务器设置 connection 参数: $db['default']['hostname'] = "yo ...
- Ajaxupload插件超级简单使用(php的ci框架)
Ajaxupload简单使用 友情提示:1.蓝色文字为必修改内容.2.#字符后面是解释该代码段的主要内容 备注: 该实例是用php的ci框架直接接收图片并 ...
- apache php 配置 CI 框架
声明:配置域名需要用到 httpd.conf httpd_vhosts.conf (apache) 中两个文件 和 hosts (C:\Windows\System32\drivers\et ...
- nginx location匹配顺序及CI框架的nginx配置
Nginx location匹配顺序如下: 用前缀字符串定义的location规则对URI进行匹配测试. =号定义了精确的前缀字符串匹配,如果发现精确匹配则使用当前规则.否则继续下一步匹配. 匹配其它 ...
- CI框架简单使用
CodeIgniter框架 1.回忆MVC 1.1.M:模型,提供数据,保存数据 1.2.V:视图,只负责显示,表单form 1.3.C:控制器,协调模型和视图 1.4.action:动作,是控制器中 ...
- Nginx配置CI框架问题(Linux平台下Centos系统)
CI框架:官方文档 http://codeigniter.org.cn/user_guide/index.html CI框架的数据流程图如下: 其中:index.php作为入口文件,在安装好CI框架后 ...
随机推荐
- Java的String中的subString()方法
方法如下: public String substring(int beginIndex, int endIndex) 第一个int为开始的索引,对应String数字中的开始位置, 第二个是截止的索引 ...
- Java面向对象编程 第一章 面向对象开发方法概述
一.软件开发经历的生命周期: ①软件分析 ②软件设计 ③软件编码 ④ 软件测试 ⑤ 软件部署 ⑥软件维护 二.为了提高软件开发效率,降低软件开发成本,一个优良的软件系统应该具备以下特点: ① 可重用性 ...
- Hibernate对象标识符
Hibernate提供的内置标识符生成器 Java语言按内存地址来识别或区分同一个类的不同对象,而关系数据库按主键来识别或区分同一个表的不同记录.Hibernate使用OID(对象标识符)来统一两者之 ...
- React-Router学习整理
欢迎大家指导与讨论 : ) 一.前言 本文摘要:react-router的基本用法,动画效果与路由,路由权限控制,路由离开确认,根据路由切分的按需加载,路由组件的属性.本文是笔者在学习时整理的笔记,由 ...
- [网络安全] [视频分享]KaLi Linux基础培训2016 最新的哦【福吧资源网】
最新的教程同时针对kali linux2016最新版本的多个问题解决办法还有一些实例利用. 下载地址:http://www.fu83.cn/thread-310-1-1.html
- 遭遇input与button按钮背景图失效不显示的解决办法
笔者从事网页前端代码页面工程师已有多年,作为一个网页重构人员常常会遇到一些莫名其妙的DIV+CSS(正确的说法是XHTML+CSS)在 IE.FireFox火狐. 谷歌浏览器CHROME.苹果浏览器S ...
- poj1986 LCA
Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 11759 Accepted: 4157 ...
- mysql-批量修改表字段中的某一部分内容
MySQL批量替换指定字段字符串语句(1)updat 表名 set 字段名=replac(字段名,'原来的内容','替换后的内容') 举一个例子,就是我实际操作的时候的命令: update cpg14 ...
- shell中测试命变量是否已经定义
(1)sehll实例 # cat subshell #!/bin/bash if (set -u; : $var); then #冒号与$间有空格 echo "Variable is set ...
- Python笔记(3)迭代器与生成器
参考自:http://www.cnblogs.com/huxi/category/251137.html 迭代器 迭代器是访问集合内元素的一种方式,他不能倒退只能一直迭代下去.可以写到for循环in后 ...