Nginx 开启 path_info功能
server {
listen ;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
root "E:/phpStudy/WWW";
location / {
index index.html index.htm index.php l.php;
autoindex off;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php/$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php/$1;
}
}
#error_page /.html;
# redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
编辑Nginx配置文件 一般在 /etc/nginx/conf.d 目录下 红色部分按如上配置
Nginx 开启 path_info功能的更多相关文章
- 源码安装nginx开启SSL功能
编译安装nginx的环境 yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel 下载nginx安装包 cd /usr/ ...
- Nginx开启gzip压缩功能
在Nginx安装完成之后,我们可以开启Gzip压缩功能,这里Nginx默认只能对text/html类型的文件进行压缩.下面的指令为开启Gzip的指令: gzip on; gzip_http_versi ...
- nginx开启网站目录浏览功能
一.开启全站目录浏览功能 编辑nginx.conf, 在http下面添加以下内容: autoindex on; # 开启目录文件列表 autoindex_exact_size on; # 显示出文件的 ...
- Nginx 状态信息功能配置
Nginx 状态信息功能介绍 Nginx 有一个 ngx_http_stub_status_module 模块,主要功能是记录 Nginx 的基本访问状态信息,让使用者了解 Nginx 的工作状态 要 ...
- Nginx性能优化功能- Gzip压缩(大幅度提高页面加载速度)
Nginx开启Gzip压缩功能, 可以使网站的css.js .xml.html 文件在传输时进行压缩,提高访问速度, 进而优化Nginx性能! Web网站上的图片,视频等其它多媒体文件以及大文件,因 ...
- Nginx启动SSL功能
Nginx启动SSL功能,并进行功能优化,你看这个就足够了 一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 nginx: [emerg] the &q ...
- 启动Nginx目录浏览功能及 让用户通过用户名密码认证访问web站点
一.启动Nginx目录浏览功能 [root@abcdocker extra]# cat w.conf server { listen 80; server_name IP地址; location / ...
- Nginx代理缓存功能
Nginx代理缓存功能 Nginx缓存主要是用于减轻后端服务器的负载,提高网站并发量,提升用户体验度. 注意:Nginx反向代理的缓存功能是由ngx_http_proxy_module提供, ...
- Nginx开启gzip提高页面加载速度
今天发现页面多次请求数据且加载的数据大,需要等待的时间很长 记得Nginx有gzip,可以对数据进行压缩 gzip是nginx服务器的ngx_http_gzip_module模块提供的在线实时数据压缩 ...
随机推荐
- Java NIO使用及原理分析 (一)
http://blog.csdn.net/wuxianglong/article/details/6604817
- c语言中的二分法
\\\题外:对于printf引号中的内容一定要细心书写 ; 数组由a[0]开始计数,切记:尤其是与for循环中i=1 搞混 运用a[i+1]等超前数据时 需先用 for(i=0;i<=n-1;i ...
- bootstrap-按钮组、字体图标
字体图标: <div class="container"> <div class="row"> <span class=" ...
- 更换ubuntu apt-get 源
为了优化ubuntu软件安装/更新速度,我测试了国内几家apt源的速度,发现北京交大的apt源速度相对最快,然后可以通过以下步骤更新ubuntu源 1) 备份默认的apt源 $ cd /etc/apt ...
- 性能测试工具Gatling - 设置Recorder
Gatling自带的Recorder,可以大大节省我们书写scenario的时间. 用法和selenium的IDE类似,作为一个代理服务器在browser和application之间做桥梁作用 ...
- ubuntu入门知识
1.linux系统发展历史 unix -> Linux -> ubuntu linux发展轨迹图 2.ubuntu下载和安装 推荐使用长期支持版本: 10.04,12.04,14.04或L ...
- 学习MVC框架的步骤
1.搭建环境 2.了解控制层和视图层的映射 3.控制层和视图层的传值 交互 4.异常处理 5.页面标签 6.文件上传 7.框架源代码
- CRM 2016 自动保存 Save event arguments
Save event arguments (client-side reference) Applies To: Dynamics CRM 2016, Dynamics CRM Online In ...
- spring mvc中的json整合
spring mvc整合过程中是有版本兼容的问题.具体的哪个版本的springmvc和哪个个版本的json包冲突我也无从考证了.我用的springmvc版本是3.2.1jaskson的版本是 1.1. ...
- Windows 7(x64)下安装Ubuntu12.4
对于想安装双系统,但是U盘无法引导安装Ubuntu的,下面的办法是很有效的. 〇.BIOS设置 启动选择:Legacy 一.使用U大师分区 U大师U盘装系统Win03pe工具箱V2.1 磁盘分配情况( ...