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模式的更多相关文章

  1. nginx服务器设置url的优雅链接

    对于LNMP这样架构的网站来说,一般都是基于php框架开发,php框架一般都会讲究优雅链接,比如Laravel,CodeIgniter,ThinkPHP等都是支持这种链接模式的,在服务器配置上也叫作u ...

  2. nginx 自启动设置

    首先,在linux系统的/etc/init.d/目录下创建nginx文件,使用如下命令: 1 vim /etc/init.d/nginx 在脚本中添加如下命令: #!/bin/sh # # nginx ...

  3. 2.4 Nginx服务器基础配置指令

    2.4.1 nginx.conf文件的结构 2.4.2配置运行Nginx服务器用户(组) 2.4.3配置允许生成的worker process数 2.4.4 配置Nginx进程PID存放路径 2.4. ...

  4. 配置nginx支持path_info模式

    简介:我们用thinkphp,CodeIgniter框架的时候,地址基本都是IP/index.php/group_controller?***的模式,通过index.php入口访问php文件 这种模式 ...

  5. nginx配置PATH_INFO模式

    我们可以使用PATH_INFO来代替Rewrite来实现伪静态页面, 另外不少PHP框架也使用PATH_INFO来作为路由载体 在Apache中, 当不加配置的时候, 对于PHP脚本, Accept ...

  6. Nginx服务器不支持PATH_INFO的问题及解决办法

    最近在写一个小程序,然后里面自己写了个URL的处理器,比如说访问index.php/article 那么就会自动加载进来article页面,访问index.php/home就会自动加载home页面. ...

  7. nginx服务器绑定域名和设置根目录的方法

    nginx服务器绑定域名以及设置根目录非常方便,首先进入nginx安装目录,然后执行 vim conf/nginx.conf 打开nginx的配置文件,找到 server { ..... ..... ...

  8. Nginx 服务器性能参数设置

    Nginx服务器性能调优 Nginx 配置文件 1.根据CPU内核数设置worker进程个数,以12核CPU为例,设置11个worker进程: worker_processes 11; worker_ ...

  9. 使用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; ...

随机推荐

  1. CSS 3中细线边框如何实现?

    在app应用开发中,我们常常都需要用到css3来设置应用的样式.由于app都是在移动设备上进行展示,所以边框描边的线一般都小于1px,而以往我们使用的都是1px及以上的.那么问题来了,对于小于1px的 ...

  2. 三十道DP练习(持续更新)(pw:DP)

    前言: 话说DP这种纯考思维的题目,总是让我很伤脑筋,一些特别简单的DP我都常常做不出来,所以革命从现在(2018-05-01)开始,努力多刷点DP的练习-. 1.顺序对齐(align) 时间:201 ...

  3. [CF845G]Shortest Path Problem?

    题目大意:同这道题,只是把最大值变成了最小值 题解:略 卡点:无 C++ Code: #include <cstdio> #define maxn 100010 #define maxm ...

  4. 70种简单常用的JS代码

    1.后退 前进      <input type="button" value="后退" onClick="history.go(-1)&quo ...

  5. 一天一条linux命令 for zipon

    linux学习网站:https://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html 19.dhclient eth0 使网卡生效, ...

  6. visual studio 2005 win7 64位版下载

    http://www.121down.com/soft/softview-19659.html 软件标签: visual studio visual studio 2005是由微软推出的一款基于.ne ...

  7. java基础练习 19

    public class Ninetheen { /*求1+2!+3!+...+20!的和*/ public static void main(String[] args){ int i,j; lon ...

  8. Laravel5.1忽略Csrf验证的方法

    在/App/Http/middleware/VerifyCsrfToken.php 文件的protected $except里面加入路由地址

  9. 在MSSQL中将数字转换成中文

    具体代码如下: CREATE FUNCTION [dbo].[fn_NumberToChinese] (@number INT) ) AS BEGIN ); ); ); SET @res = ''; ...

  10. 我在16aspx网上下载了个C#源码,如何能在我自己的计算机上跑起来,很急!求详细操作过程!

    先搞清楚是WINDOWS程序还是WEB程序.