How To Set Nginx Support PATHINFO URL Model And Hide The /index.php/

就像这样

The URL before setting like this:

http://serverName/index.php?m=Home&c=Customer&a=getInformation&id=1

Now like this:

http://serverName/Home/Customer/getInformation/id/1

这是偶的配置:

server {

listen       80;

server_name  mybuy.com;

root   /Users/he/Projects/maibei-backend;

#charset koi8-r;

access_log  /Users/he/weblog/mybuy.com.access.log;

error_log   /Users/he/weblog/mybuy.com.error.log;

location / {

if (!-e $request_filename) {

rewrite  ^(.*)$  /index.php?s=$1  last;

break;

}

index  index.php index.html index.htm;

}

# pass the PHP scripts to FastCGI
server listening on 192.168.1.123:9000

#

location ~ \.php {

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;

include        fastcgi_params;

set $path_info "";

set $real_script_name $fastcgi_script_name;

if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {

set $real_script_name $1;

set $path_info $2;

}

fastcgi_param
SCRIPT_FILENAME $document_root$real_script_name;

fastcgi_param
SCRIPT_NAME $real_script_name;

fastcgi_param
PATH_INFO $path_info;

}

}

nginx支持pathinfo并且隐藏index.php的更多相关文章

  1. codeigniter在nginx 下支持pathinfo和去除index.php的方法

    as今天准备把网站搬迁到nginx上发现codeigniter框架在nginx上不能使用,后来发现是nginx不支持pathinfo,下面介绍怎么在nginx下开启pathinfo 开始pathinf ...

  2. 配置Nginx支持pathinfo模式

    Nginx服务器默认不支持pathinfo, 在需要pathinfo支持的程序中(如thinkphp),则无法支持”/index.php/Home/Index/index”这种网址.网上流传的解决办法 ...

  3. nginx支持pathinfo模式

    很久不使用apache了,渐渐对apache感到陌生,因为朋友有个ZendFramework框架从apache移到nginx下,需要pathinfo模式支持.网上海搜于是开始搜索nginx+pathi ...

  4. 使得nginx支持pathinfo访问模式

    原理:     任意创建一个 in.php 文件:             <?php                       echo '<pre>';             ...

  5. 使nginx支持pathinfo模式

    在将fastadmin部署到虚拟机中时,遇到如下问题:当访问登录页面时,页面进行不断的循环跳转重定向.解决方法是将nginx配置为支持pathinfo的模式 以下是nginx中的配置内容: locat ...

  6. TP5框架 nginx服务器 配置域名 隐藏index.php

    server { listen ; #server_name localhost; server_name hhy.com;/**这里写自己的域名*/ #charset koi8-r; #access ...

  7. centOS7.4 thinkPHP nginx 支持pathinfo和rewrite

    server { listen 80; server_name www.demo.com mayifanx.com; root /data/www/demo; index index.php inde ...

  8. 让Nginx支持pathinfo

    # 典型配置 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_ ...

  9. Nginx 虚拟主机下支持Pathinfo并隐藏入口文件的完整配置

    server { listen 80; server_name zuqiu.com; # 设置你的域名 index index.html index.htm index.php; root D:/wn ...

随机推荐

  1. kubernetes 内网节点部署笔记(一)

    在Centos7上部署kubernetes时,碰到很多坑,特别在摸拟在内网部署时,有来自GFW的障碍,有来自Firewalld的阻塞,反正是各种不服,终于慢慢理顺了思路,自己记录一下,防止遗忘. 环境 ...

  2. css体验优化之图片容器设置宽高比

    需求 我们在做web页面的时候,经常会有一些图片列表,例如下图的视频列表以及表情列表:        需求要求: 1. 列表是responsive的,在不同宽度的浏览器下面,图片要自适应容器宽度 2. ...

  3. Struts2:上传下载

    ud_upload.jsp <s:form action="fileupload" enctype="multipart/form-data"> & ...

  4. Maven(一)maven环境搭建

    1.下载maven安装文件 https://maven.apache.org/download.cgi#,根据自己的需要下载对应版本 2. 配置maven环境变量,和java环境变量配置方式类似.   ...

  5. linux 查看系统信息

    一.查看内存信息 可以使用free命令显示系统的物理内存和交换分区的总量,以及已使用的.空闲的.共享的.在内核缓冲内的和被缓存的内存数量. 使用free命令可以显示计算机系统的内存容量. [root@ ...

  6. ubuntu-利用pdnsd-TCP方式获取IP-拒绝DNS污染

    那,自从国内技术出现了DNS污染问题呢,时常导致很多国外网站访问不正常,所以通过参考一些博客所属避免DNS污染的方法,决定搭建一个Ubuntu JeOS下的DNS缓存服务器,该服务器利用TCP方式获取 ...

  7. 安装完Pydev却无法创建Python工程

    为了方便以后工作,今天在ADT里面安装了Pydev(http://pydev.org/updates),可是安装完之后,新建项目的时候却找不到Pydev,perference中也没有. 紧接着尝试安装 ...

  8. Cocos2d-x-3.0 Touch事件处理机制

    在学习Cocos2d-html5游戏例子的时候,注册事件代码一直提示:TypeError: cc.Director._getInstance(...).getTouchDispatcher is no ...

  9. 显示全部select change 异常

    异常信息(异常类型:Genersoft.Platform.Core.Error.GSPException)异常提示:调用方法SelectChange发生异常,详细请看内部异常信息!异常信息:调用方法S ...

  10. 图片转base64

    function convertImgToBase64(url, callback, outputFormat){ var canvas = document.createElement('CANVA ...