nginx上布置thinkphp
2016-05-11 17:07
621 查看
thinkphp config配置:
nginx rewrite配置:
如果你的ThinkPHP安装在二级目录,Nginx的伪静态方法设置如下,其中youdomain是所在的目录名称
'URL_MODEL' => '2', //URL模式
nginx rewrite配置:
location / { set $static 0; if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) { root /data/www; set $static 1; } if (!-e $request_filename){ set $static 0$static; } if ($static = 00){ rewrite ^/(.*)$ /index.php?s=$1 last; } }
如果你的ThinkPHP安装在二级目录,Nginx的伪静态方法设置如下,其中youdomain是所在的目录名称
location /yourdomain/ { set $static 0; if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) { root /data/www; set $static 1; } if (!-e $request_filename){ set $static 0$static; } if ($static = 00){ rewrite ^/yourdomain/(.*)$ /yourdomain/index.php?s=$1 last; } }
相关文章推荐
- nginx相关
- ELK集群部署及收集nginx日志
- nginx基本配置
- nginx配置实例
- nginx新用户指导手册
- LNMP源码编译安装(centos7+nginx1.9+mysql5.6+php7)
- windows环境配置 nginx + php + mysql
- Nginx负载均衡和Keepalived的安装设置
- 【Linux进阶】CentOS安装Nginx服务器
- Nginx 概述及日常管理
- Nginx 配置一个虚拟站点
- Nginx配置文件详细说明
- nginx负载均衡模块
- Nginx安装
- Nginx 502 Bad Gateway的处理
- window 下安装nginx、php 、mysql过程及配置详解
- Nginx负载均衡+监控状态检测
- 获取安装后Apache、MySQL、Nginx、PHP编译时参数
- Nginx配置之基于域名的虚拟主机
- 轻松使用Nginx搭建web服务器