#user root;
#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root /web/html;
index index.php index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root 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 /web/html;   //这里是修改的根目录
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;
#}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}

# HTTPS server
#
#server {
# listen 443;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}

注意:

把大小写敏感的配置文件convention.php去修改成true.

nginx配置使其支持thinkphp的pathinfo模式的更多相关文章

  1. LNMP 支持 ThinkPHP 的 pathinfo 模式

    注意使用LNMP 1.4版 1.修改php.ini 启用pathinfo /usr/local/php/etc/php.ini cgi.fix_pathinfo = 0 值改为1 2.修改/usr/l ...

  2. 配置nginx1.8支持thinkPHP3.2 pathinfo模式

    nginx 下conf/nginx.conf 或者自己的vhosts更改以前的参数 location / { root   html; index  index.html index.htm inde ...

  3. Ubuntu配置Nginx虚拟主机和支持ThinkPHP

    [Nginx配置虚拟主机] 每一个 server { listen       80;         server_name  www.a.com; ..... } 就表示一台虚拟域名, 然后对应的 ...

  4. Nginx下支持ThinkPHP的Pathinfo和URl Rewrite模式

    下面介绍如何使Nginx支持ThinkPHP的Pathinfo和URL Rewrite模式. 1.ThinkPHP给出了ThinkPHP的官方解决方案,如下: 打开Nginx的配置文件 /etc/ng ...

  5. Apache下开启SSI配置使html支持include包含

    写页面的同学通常会遇到这样的烦恼,就是页面上的 html 标签越来越多的时候,寻找指定的部分就会很困难,那么能不能像 javascript 一样写在不同的文件中引入呢?答案是有的,apache 能做到 ...

  6. Laya 爆改Laya IDE和Laya引擎使其支持2D粒子爆发模式

    Laya 爆改Laya IDE和Laya引擎使其支持2D粒子爆发模式 @author ixenos 2019-11-01 19:47:26 1. 修改IDE的功能需要深入到/resources/app ...

  7. Atom 编辑器安装 linter-eslint 插件,并配置使其支持 vue 文件中的 js 格式校验

    安装方式有如下几种. 1.最常用的安装方式. # 进入atom插件文件夹 cd ~/.atom/packages/ # git clone 插件源文件 git clone https://github ...

  8. nginx配置反向代理支持session

    Nginx反向代理tomcat,很是方便,但是也有些细节的问题需要注意:今天遇到了这样一个问题,tomcat中路径“host/web1”,nginx中直接“host/”代理,这时候session就无法 ...

  9. ThinkPHP中pathinfo模式与URL重写

    Thinkphp中的pathinfo模式 http://serverName/appName/module/action/id/1/ pathinfo模式 在不考虑路由的情况下,第一个参数会被解析成模 ...

随机推荐

  1. centos7安装VLC播放器

    centos7安装VLC播放器 1.安装eple 下载地址:https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noar ...

  2. 【转】Android Studio安装配置学习教程指南 Gradle基础--不错

    原文网址:http://www.linuxidc.com/Linux/2015-02/113890p4.htm 其实很早之前也写了一篇Gradle的基础博客,但是时间很久了,现在Gradle已经更新了 ...

  3. 运行出现 Multiple dex files define Landroid/support/annotation/AnimRes 解决方法

    1. 拷贝google-play-services_lib/libs/目录下的android-support-v4.jar到xxxr/libs/下 2. 工程进行如下设置:

  4. migration vmware vms to openstack kvm 修改vmware windows scsi to ide

  5. 15个不起眼但非常强大的 Vim 命令

    如果我的关于这个话题的最新帖子没有提醒到你的话,那我明确地说,我是一个 vim 的粉丝.所以在你们中的某些人向我扔石头之前,我先向你们展示一系列“鲜为人知的 Vim 命令”.我的意思是,一些你可能以前 ...

  6. java排序算法-交换排序

    public class ExchangeSortUtils { // 冒泡 public static void bubbleSort(int[] array) { int length = arr ...

  7. Data Guard 之 浅析Switchover与Failover

    Data Guard主从库之间的角色切换分为以下两种:1)SwitchoverSwithchover通常都是人为的有计划的进行角色互换,比如升级等.它通常都是无损的,即不会有数据丢失.其执行主要分为两 ...

  8. Java并发编程:sleep、wait、yield对比

    首先,wait()和notify(),notifyAll()是Object类的方法,sleep()和yield()是Thread类的方法. (1).常用的wait方法有wait()和wait(long ...

  9. java 中流的使用

    Java中的流,可以从不同的角度进行分类. 一.按照数:输入流和输出流. 输出流: 输入流: 因此输入和输出都是从程序的角度来说的. 二.按照处理数据单位不同可以分为:字节流和字符流. 字节流和字符流 ...

  10. Python标准库:内置函数bytearray([source[, encoding[, errors]]])

    返回一个新字节数组.这个数组里的元素是可变的.而且每一个元素的值范围: 0 <= x < 256.能够通过"字节与字节数组操作"章节来查看相关字节数组的内容.以下说明一 ...