nginx服务器设置path_info模式
1.find / -name nginx.conf找到nginx配置文件
2.
#
# The default server
#
server {
listen 80;
#填写自己的域名
server_name www.bestcfm.com;
#charset koi8-r;
#access_log logs/host.access.log main;
# Load configuration files for the default server block.
location / {
root /var/www/html/public;
index index.html index.php index.htm;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/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 /var/www/html/public;
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;
#}
}
3.重启nginx,find / -name nginx找到sbin目录执行./nginx -s reload
nginx服务器设置path_info模式的更多相关文章
- nginx服务器设置url的优雅链接
对于LNMP这样架构的网站来说,一般都是基于php框架开发,php框架一般都会讲究优雅链接,比如Laravel,CodeIgniter,ThinkPHP等都是支持这种链接模式的,在服务器配置上也叫作u ...
- nginx 自启动设置
首先,在linux系统的/etc/init.d/目录下创建nginx文件,使用如下命令: 1 vim /etc/init.d/nginx 在脚本中添加如下命令: #!/bin/sh # # nginx ...
- 2.4 Nginx服务器基础配置指令
2.4.1 nginx.conf文件的结构 2.4.2配置运行Nginx服务器用户(组) 2.4.3配置允许生成的worker process数 2.4.4 配置Nginx进程PID存放路径 2.4. ...
- 配置nginx支持path_info模式
简介:我们用thinkphp,CodeIgniter框架的时候,地址基本都是IP/index.php/group_controller?***的模式,通过index.php入口访问php文件 这种模式 ...
- nginx配置PATH_INFO模式
我们可以使用PATH_INFO来代替Rewrite来实现伪静态页面, 另外不少PHP框架也使用PATH_INFO来作为路由载体 在Apache中, 当不加配置的时候, 对于PHP脚本, Accept ...
- Nginx服务器不支持PATH_INFO的问题及解决办法
最近在写一个小程序,然后里面自己写了个URL的处理器,比如说访问index.php/article 那么就会自动加载进来article页面,访问index.php/home就会自动加载home页面. ...
- nginx服务器绑定域名和设置根目录的方法
nginx服务器绑定域名以及设置根目录非常方便,首先进入nginx安装目录,然后执行 vim conf/nginx.conf 打开nginx的配置文件,找到 server { ..... ..... ...
- Nginx 服务器性能参数设置
Nginx服务器性能调优 Nginx 配置文件 1.根据CPU内核数设置worker进程个数,以12核CPU为例,设置11个worker进程: worker_processes 11; worker_ ...
- 使用nginx服务器如果遇到timeou情况时可以如下设置参数,使用fastcgi: fastcgi_connect_timeout 75; 链接 fastcgi_read_timeout 600; 读取 fastcgi_send_timeout 600; 发请求
使用nginx服务器如果遇到timeou情况时可以如下设置参数,使用fastcgi: fastcgi_connect_timeout 75; 链接 fastcgi_read_timeout 600; ...
随机推荐
- 【bzoj5055】膜法师 离散化+树状数组
题目描述 给定一个序列$a$,求满足$i<j<k$且$a_i<a_j<a_k$的三元组$(i,j,k)$的个数. 输入 第一行1个数 n 第二行n个数 a_i 输出 一个数,表 ...
- ESXI6.0 时间(时区)显示不一致
ESXI6.0 时间(时区)显示不一致 来源 http://blog.51cto.com/jdonghong/1957118 近日由于设置ESXI计划任务,无意间发现了esxi服务器客服端时间和系统显 ...
- [HNOI2015][bzoj4011] 落叶枫音 [拓扑DP]
题面 传送门 思路 首先有一个结论(应该是有比较大的利用价值的): 有向无环图的生成外向树树个数等于所有入度非0的点的入度乘积 然后这道题里面,唯一不合拍的因素就是这里有一条可能成环的边 我们可以把这 ...
- 在Ignite中使用k-最近邻(k-NN)分类算法
在本系列前面的文章中,简单介绍了一下Ignite的线性回归算法,下面会尝试另一个机器学习算法,即k-最近邻(k-NN)分类.该算法基于对象k个最近邻中最常见的类来对对象进行分类,可用于确定类成员的关系 ...
- 洛谷 P2041 分裂游戏 解题报告
P2041 分裂游戏 题目描述 有一个无限大的棋盘,棋盘左下角有一个大小为 n 的阶梯形区域,其中最左下角的那个格子里有一枚棋子.你每次可以把一枚棋子"分裂"成两枚棋子,分别放在原 ...
- unicode 编码在线转换工具--javascript
http://www.cnblogs.com/mq0036/p/4007452.html
- java equals 与 hashCode
转:http://m.blog.csdn.net/blog/pengchua/2297547# 如果你为某个类写了equals方法,那么应该同时编写hashCode方法.如果没有提供hashcode方 ...
- linux -特殊符号
在shell中常用的特殊符号罗列如下: # ; ;; . , / \\ 'string'| ! $ ${} $? $$ $* \"string\"* ** ...
- 汕头市队赛SRM15
T1——czl SRM 15 众所周知,czl家养了一只可♂爱的***(已屏蔽),那只东西很贪吃,所以czl家很多零食仓库,然而这些仓库里有很多老鼠. 为了心爱的***,czl决定点燃纯艾条,用烟熏老 ...
- 关于tbody js取法兼容。
本来jquery就是为了兼容才用的,动态添加表格的时候,ie必须要append 到tbody上,不然无法取上. 而chrome等则可以,最终还是选appendto tobody