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. Emergency(山东省第一届ACM省赛)

    Emergency Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Kudo’s real name is not Kudo. H ...

  2. js 处理 html 标签转义 处理json中含有的ascii 编码

    function escape2Html(str) { var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&am ...

  3. EJB 教程推荐

    EJB教程 EJB概述 EJB创建应用 EJB无状态Bean EJB有状态会话Bean EJB持久性 EJB消息驱动Bean EJB注解 EJB回调 EJB定时器服务 EJB依赖注入 EJB拦截器 E ...

  4. 尚学堂Spring视频教程(四):使用Annotation

    之前我们的bean都配置在XML里,并且通过bean的property标签来指定依赖关系,如果项目很大,那岂不是要配置很多这样的property标签?Spring提供了注解的方式来解决这个问题 @Au ...

  5. delphi.数据结构.链表

    链表作为一种基础的数据结构,用途甚广,估计大家都用过.链表有几种,常用的是:单链表及双链表,还有N链表,本文着重单/双链表,至于N链表...不经常用,没法说出一二三来. 在D里面,可能会用Contnr ...

  6. fw: webdriver 那些坑

    http://www.cnblogs.com/huang0925/p/3384596.html 使用WebDriver遇到的那些坑   在做web项目的自动化端到端测试时主要使用的是Selenium ...

  7. Maven依赖版本冲突的分析及解决小结

    1:前言 做软件开发这几年遇到了许多的问题,也总结了一些问题的解决之道,之后慢慢的再遇到的都是一些重复性的问题了,当然,还有一些自己没有完全弄明白的问题.如果做的事情是重复的,遇到重复性问题的概率也就 ...

  8. Effective c++

    static 声明在堆上申请静态存储 对于局部变量,将存储方式改为静态存储 对于全局变量,将连接方式局限在文件内 类中static变量:属于整个类,独立存储,没有this指针 inline inlin ...

  9. 显示全部select change 异常

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

  10. JQUERY DIALOG窗格内不能使用FORM

    今天在做AJAX DIALOG数据提交实验,实验目的是,在DIALOG内显示另一页面,并将FORM组件信息提交保存至数据库.代码如下: DIALOG实现: function OpenDialog(ur ...