Comments (5)
谢谢提议,是我的疏忽下个版本将会修改!
from easyimages2.0.
在网站conf文件添加以下内容后无法显示图片,直接访问直链是403. 权限是
0755
root@xxx:/abcd# ls -ld EasyImages/
drwxr-xr-x 8 www-data www-data 4096 Jan 25 09:21 EasyImages/
#禁止运行php的目录 "i"是你的上传图片目录
location ~ /(i)/.*.(php|php5)?$ {
deny all;
#}后面试着改成以下内容后又可以显示了
location ~ ^/(i)/.*\.(php|php5)?$ {
为啥我没遇到这个问题
from easyimages2.0.
在网站conf文件添加以下内容后无法显示图片,直接访问直链是403. 权限是
0755
root@xxx:/abcd# ls -ld EasyImages/
drwxr-xr-x 8 www-data www-data 4096 Jan 25 09:21 EasyImages/
#禁止运行php的目录 "i"是你的上传图片目录
location ~ /(i)/.*.(php|php5)?$ {
deny all;
#}后面试着改成以下内容后又可以显示了
location ~ ^/(i)/.*\.(php|php5)?$ {
为啥我没遇到这个问题
可能你的压根没生效
from easyimages2.0.
server
{
listen 80;
server_name easyimage.*;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/easyimage;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
#PHP-INFO-START PHP引用配置,可以注释或修改
include enable-php-73.conf;
#PHP-INFO-END
#REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/easyimage.kingchl.cn.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
# 上传目录禁止运行`PHP`程序
location ~ /(i)/.*.(php|php5)?$
{
deny all;
}
location ^~ /config/
{
deny all;
}
access_log /www/wwwlogs/easyimage.kingchl.cn.log;
error_log /www/wwwlogs/easyimage.kingchl.cn.error.log;
}
我直接在宝塔的Nginx配置文件里插入这几句,这么做无法生效呀?
from easyimages2.0.
root /www/wwwroot/easyimage;
把
location ~* ^/(i|public)/.*\.(php|php5)$
{
deny all;
}
放到 root /www/wwwroot/easyimage;
后边才能生效,你可以尝试下你现在的配置
from easyimages2.0.
Related Issues (20)
- 广场显示所有上传的图片 HOT 1
- 使用api上传提示204错误 HOT 1
- 如何修改为无视单文件上传100M的限制?
- 关于验证码在php8.0环境下显示不出来问题 HOT 1
- Feat|>希望能添加docker部署 HOT 3
- 我反向代理了端口,显示界面出错
- TinyFileManage无法正常使用
- 希望支持docker HOT 1
- Mixed Content Issue When Accessing Resources Over HTTPS HOT 2
- edge浏览器,首页上传的粘贴功能无效 HOT 1
- 2.0版本安装环境监测时遇到问题 HOT 4
- 怎么获取最近上传的图片URL? HOT 1
- 输入账号密码后点击登录,总是回跳到登录页面
- API说明文档中python示例测试不成功,payload参数应该怎么设定? HOT 1
- 不知道为什么PHP搭建的项目总是被挖矿 HOT 2
- 查看已经上传图像的链接 HOT 1
- 隐藏存储路径不生效 HOT 7
- 登录重复跳转问题 HOT 2
- 求求求!!!后台删除图片了还能显示, HOT 1
- 安装完之后主页出现的错误提示
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easyimages2.0.