63 Star 171 Fork 60

www.tpframe.com / tpframe

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
nginx.conf 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
Frame 提交于 2019-08-31 08:41 . 更新nginx配置说明
# 该配置文件为nginx配置参考,请根据自己的情况进行相应的调整
# 通常放置在/etc/nginx/conf.d下 或 /usr/local/nginx/conf/nginx.conf 或 vhost目录(域名单独配置),主要配置如下
server{
listen 80;
server_name demo.tpframe.com;
root /home/www/tpframe; # 此为你的网站根目录
location / {
index index.php index.html index.htm;
#重写规则配置
if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php?s=$1 last;
#若是子目录则使用下面这句,将subdir改成目录名称即可,不建议放子目录
#rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1 last;
}
}
#下面是设置访问权限的一些配置
location ~*/(coreframe|application|extend) {
return 404;
}
location ~*\/theme\/frontend\/(.*).(html|php)$ {
return 404;
}
location ~*\/theme\/backend\/(.*).(html|php)$ {
return 404;
}
location ~* ^\/(data|addon)\/(.*).(html|php)$ {
return 404;
}
#记住一定要放到如下配置文件的上面才生效(下面是不要的)
location ~ [^/]\.php(/|$) {
...
}
location ~ .php(/|$) {
...
}
# 省略其它配置文件...
}
PHP
1
https://gitee.com/37duman/tpframe.git
git@gitee.com:37duman/tpframe.git
37duman
tpframe
tpframe
master

搜索帮助