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. MySQL中tinytext、text、mediumtext和longtext详解

    一.数字类型 类型 范围 说明   Char(N) [binary] N=1~255 个字元binary :分辨大小写 固定长度 std_name cahr(32) not null VarChar( ...

  2. Android性能优化典范

    来源:http://hukai.me/android-performance-patterns/#jtss-tsina 0)Render Performance 大多数用户感知到的卡顿等性能问题的最主 ...

  3. RabbitMQ小结

    1.帮助文档 rabbitmq官网:http://www.rabbitmq.com/ rabbitmq谷歌论坛:https://groups.google.com/forum/#!forum/rabb ...

  4. Ubuntu12.04解决gedit中文乱码问题

    Ubuntu12.04,终端中分别输入下面两条指令: gsettings set org.gnome.gedit.preferences.encodings auto-detected “['GB18 ...

  5. OpenGL学习笔记3——缓冲区对象

    在GL中特别提出了缓冲区对象这一概念,是针对提高绘图效率的一个手段.由于GL的架构是基于客户——服务器模型建立的,因此默认所有的绘图数据均是存储在本地客户端,通过GL内核渲染处理以后再将数据发往GPU ...

  6. FTP地址格式如下:“ftp://用户名:密码@FTP服务器IP”

    FTP地址格式如下:“ftp://用户名:密码@FTP服务器IP”

  7. 安卓手机屏幕录像之scr

    打开SCR Screen Recorder,屏幕会显示录像控制面板,点击“开始”按钮就可以开始录像: - 停止录像的方法有两种.一种是锁屏,锁屏后等待2秒,录像文件会自动保存到SD卡,另外一种是重新打 ...

  8. VMware Workstation下安装centos提示硬盘不支持的解决方法

    最近在搞centos,遇见的一些问题,记录一下 首先是安装问题 安装过程参考http://www.cnblogs.com/seesea125/archive/2012/02/25/2368255.ht ...

  9. win10 MySQL启动失败问题

    系统升级到win10之后,本地装的MySQL却突然不能启动,系统显示明明就有,可是总是启动失败.在这里解决一下: 解决win10  mysql服务消失,连接不上的问题,注意:以管理员身份运行DOS命令 ...

  10. Winform Textbox MultiLine和WordWrap属性的使用

    突然用到,有些不明白,零乱记录下: 1.MultiLine属性为True时,Dock属性Fill值才能达到所需效果 2.MultiLine属性为False时,WordWrap属性也是无效果的,同1,T ...