nginx配置使其支持thinkphp的pathinfo模式
#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模式的更多相关文章
- LNMP 支持 ThinkPHP 的 pathinfo 模式
注意使用LNMP 1.4版 1.修改php.ini 启用pathinfo /usr/local/php/etc/php.ini cgi.fix_pathinfo = 0 值改为1 2.修改/usr/l ...
- 配置nginx1.8支持thinkPHP3.2 pathinfo模式
nginx 下conf/nginx.conf 或者自己的vhosts更改以前的参数 location / { root html; index index.html index.htm inde ...
- Ubuntu配置Nginx虚拟主机和支持ThinkPHP
[Nginx配置虚拟主机] 每一个 server { listen 80; server_name www.a.com; ..... } 就表示一台虚拟域名, 然后对应的 ...
- Nginx下支持ThinkPHP的Pathinfo和URl Rewrite模式
下面介绍如何使Nginx支持ThinkPHP的Pathinfo和URL Rewrite模式. 1.ThinkPHP给出了ThinkPHP的官方解决方案,如下: 打开Nginx的配置文件 /etc/ng ...
- Apache下开启SSI配置使html支持include包含
写页面的同学通常会遇到这样的烦恼,就是页面上的 html 标签越来越多的时候,寻找指定的部分就会很困难,那么能不能像 javascript 一样写在不同的文件中引入呢?答案是有的,apache 能做到 ...
- Laya 爆改Laya IDE和Laya引擎使其支持2D粒子爆发模式
Laya 爆改Laya IDE和Laya引擎使其支持2D粒子爆发模式 @author ixenos 2019-11-01 19:47:26 1. 修改IDE的功能需要深入到/resources/app ...
- Atom 编辑器安装 linter-eslint 插件,并配置使其支持 vue 文件中的 js 格式校验
安装方式有如下几种. 1.最常用的安装方式. # 进入atom插件文件夹 cd ~/.atom/packages/ # git clone 插件源文件 git clone https://github ...
- nginx配置反向代理支持session
Nginx反向代理tomcat,很是方便,但是也有些细节的问题需要注意:今天遇到了这样一个问题,tomcat中路径“host/web1”,nginx中直接“host/”代理,这时候session就无法 ...
- ThinkPHP中pathinfo模式与URL重写
Thinkphp中的pathinfo模式 http://serverName/appName/module/action/id/1/ pathinfo模式 在不考虑路由的情况下,第一个参数会被解析成模 ...
随机推荐
- 设计模式(六):Singleton 单件模式 -- 创建型模式
1.定义 当需要控制一个类的实例数量且调用者可以从一个公共的访问点访问时. 2.适用场景 1. 当类只能有一个实例而且客户可以从一个众所周知的访问点访问它时. 2. 当这个唯一实例应该是通过子类化可扩 ...
- 【性能测试】【Jmeter】学习(1)
2013/8/6开始阅读Jmeter文档 2013/8/7总结 监听器——CSV Data Set Config 在Jmeter中添加一个CSV配置原件 CSV配置原件添加方法:(右键点击某一个操作步 ...
- HDOJ 2092 整数解(2次方程整数解公式)
Problem Description 有二个整数,它们加起来等于某个整数,乘起来又等于另一个整数,它们到底是真还是假,也就是这种整数到底存不存在,实在有点吃不准,你能快速回答吗?看来只能通过编程. ...
- 2013.11.7-21:15_My first Java program
- Java高级特性之反射学习总结
老规矩我们还是先提出几个问题,一门技术必然要能解决一定的问题,才有去学习掌握它的价值 一. 什么是反射? 二.反射能做什么? 一. 什么是反射? 用在Java身上指的是我们可以于运行时加载.探知.使用 ...
- 一个在字符串中查找多个关键字的函数strstrs(三种不同算法实现及效率分析)
平时项目中有时需要用到在字符串中搜索两个或更多的关键字的情景.例如:将字符串"ab|cd#ef|"按竖线或者井号做分隔 如果是大项目,一般会采用正则表达式做处理.但有时写个小程序, ...
- C# 读取 Access 数据库表的例子
using System;using System.Data;using System.Data.OleDb;using System.Collections.Generic;using System ...
- oracle管道输出
通常我们会在oracle中用dbms_output输出调试信息,但dbms_output只能在调用过程完成才返回结果,不能实时输出的.这意味着通常我们经常要等几分钟或更长的时间才能看到调试信息,那怎么 ...
- 【web开发问题】HTTP请求POSTDATA中包含多层对象如何获取?
postdata如下: TravelerID=&ChineseName=***&PhoneNumber=&IDNumber=&IsCommonUse=&Gues ...
- os即时通讯客户端开发之-mac上安装MySQL
一.安装 到MySQL官网上http://dev.mysql.com/downloads/mysql/,下载mysql可安装dmg版本 比如:Mac OS X ver. 10.7 (x86, 64-b ...