1 Star 0 Fork 4

sniper/WelineFramework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nginx.conf.sample 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
#
# 你需要在你的站点nginx配置文件上设置$WELINE_ROOT变量
# 例如你的配置文件中的root /www/html/www.demo.com;
# 你需要改成 set $WELINE_ROOT /www/html/www.demo.com;
# 然后include /www/html/www.demo.com/nginx.conf.sample;
#
############# 作用代码 start ##################
root $WELINE_ROOT;
# 根目录下若是请求不到文件将重定向到index.php
if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php?s=$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
}
# 根路径访问
location /
{
# 项目访问目录
root $WELINE_ROOT/pub/;
# 如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename) {
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php?s=$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
}
}
# 静态资源访问
location /static/ {
root $WELINE_ROOT/pub/static/;
}
location ~ ^/static/.*\.(php|php5|sh|pl|py)$
{
deny all;
}
location ~ ^/images/.*\.(php|php5|sh|pl|py)$
{
deny all;
}
location ~ ^/data/(attachment|avatar).*\.(php|php5)$
{
deny all;
}
# 升级资源访问
location /setup/static/ {
root $WELINE_ROOT/setup/static/;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
root $WELINE_ROOT;
allow all;
}
# 禁止直接访问核心文件目录
location /app/ { return 404; }
location /bin/ { return 404; }
location /generated/ { return 404; }
location /extend/ { return 404; }
location /vendor/ { return 404; }
############# 作用代码 end ##################
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/ye999/WelineFramework.git
git@gitee.com:ye999/WelineFramework.git
ye999
WelineFramework
WelineFramework
dev

搜索帮助