nginx配置thinkphp3.1.3
2021/02/24 标签:
thinkphp3.1.3
nginx配置thinkphp3.1.3
.conf
server {
listen 8510;
server_name plays;
# 文件夹为think开头或者tp开头服务器报错
root "C:\Users\Administrator\Desktop\study_tp_3.1.3";
include "C:\Users\Administrator\Desktop\study_tp_3.1.3\.htaccess";
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
location / {
index index.html index.htm index.php;
#try_files $uri $uri/ /index.php$is_args$args;
#autoindex on;
}
location ~ \.php(.*)$ {
fastcgi_pass phpfastcgi_proxy;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
}.htaccess
# nginx rewrite rule # rewrite ^/q_([^-]+)-([0-9]+).html$ /search.php?q=$1&page=$2 last; rewrite ^/list/([0-9]+)$ /list/index/?id=10&type=0; rewrite ^/list/([0-9]+)/([0-9]+)$ /list/index/?id=10&type=12 last; rewrite ^/vod-([0-9]+)-([0-9]+).html$ /play.php?videoid=$1&movieOrder=$2 last; rewrite ^/vue/(.*)$ /vue/index.php last; # end nginx rewrite rule
thinkphp3.1.3中URL_ROUTE_RULES 路由配置会导致页面301跳转,不知道是不是配错了还是本该如此
下一篇:
JS取出两个数组中的不同或相同元素
静水缘首页
文章分类
最新文章
- nodejs私钥加密公钥解密的一个例子
- uniapp和微信小程序判断程序运行在开发或者测试或者线上版本的方法分别是什么
- electron使用electron-builder打包后模块包含exe文件执行失败
- Compile is disallowed on the main thread, if the buffer size is larger than 4KB
- better-sqlite3简介及常用操作
- nodejs 操作数据库的库
- nodejs使用http-proxy库实现多个域名代理和同时代理websocket的例子,代理包含https和http两种协议
- iis配置反向代理
- javascript伪多线程代码
- ip所在地址段判断