VPS侦探论坛

 找回密码
 注册
查看: 4707|回复: 10

设置nginx-lua-waf上传附件出现500 Internal

[复制链接]
发表于 2019-6-8 00:09:37 | 显示全部楼层 |阅读模式

https://www.vpser.net/build/lnmp-nginx-lua-waf-install.html

上传附件 jpg 图片 出现500 Internal

同个环境下另外一个虚拟主机没配置 正常
请问要怎么修改才行

补充内容 (2019-6-8 19:24):
【已解决】/usr/local/nginx/conf/waf/wafconf/url  这个文件里面屏蔽了 Uploads 去掉就好了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2019-6-8 03:56:28 来自手机 | 显示全部楼层


修改nginx_lua_waf的拦截屏蔽规则!具体可以参考其GitHub上的文档!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2019-6-8 09:05:02 | 显示全部楼层

什么程序?
是否改动过ngx_lua_waf的配置文件,贴一下你ngx_lua_waf的配置文件看一下
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-6-8 14:30:57 | 显示全部楼层



本帖最后由 每次醒来 于 2019-6-8 14:35 编辑
licess 发表于 2019-6-8 09:05
什么程序?
是否改动过ngx_lua_waf的配置文件,贴一下你ngx_lua_waf的配置文件看一下 ...

飞飞CMS 火车头采集入库是正常的

手动 手动 手动 上传 提示500错误



RulePath = "/usr/local/nginx/conf/waf/wafconf/"
attacklog = "on"
logdir = "/home/wwwlogs/hack/"
UrlDeny="on"
Redirect="on"
CookieMatch="on"
postMatch="on"
whiteModule="on"
black_fileExt={"php","jsp"}
ipWhitelist={"127.0.0.1"}
ipBlocklist={"1.0.0.1"}
CCDeny="off"
CCrate="100/60"
html=[[
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>网站防火墙</title>

另外一个网站同环境没有配置
access_by_lua_file /usr/local/nginx/conf/waf/waf.lua;
这个代码正常上传

Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2019-6-8 16:56:28 | 显示全部楼层

wafconf/whiteurl 里将上传代码的url加入白名单试试

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2019-6-8 18:44:47 | 显示全部楼层

本帖最后由 每次醒来 于 2019-6-8 18:49 编辑
licess 发表于 2019-6-8 16:56
wafconf/whiteurl 里将上传代码的url加入白名单试试

^/123/$
^/Uploads/$


123是默认的 在后面这样加 ^/Uploads/$  也不行  
加网址正确格式是什么


 楼主| 发表于 2019-6-8 19:05:25 | 显示全部楼层


^/123/$
^/?s=Admin-Upload-Upload/$
不行
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2019-6-8 19:23:57 | 显示全部楼层

licess 发表于 2019-6-8 16:56
wafconf/whiteurl 里将上传代码的url加入白名单试试

解决了!!

/usr/local/nginx/conf/waf/wafconf/url  这个文件里面屏蔽了 Uploads 去掉就好了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2019-6-8 19:33:43 | 显示全部楼层

本帖最后由 每次醒来 于 2019-6-8 19:39 编辑
licess 发表于 2019-6-8 16:56
wafconf/whiteurl 里将上传代码的url加入白名单试试

奇怪刚刚装好 test.php?id=../etc/passwd 是有提示防火墙拦截页面的

现在输入test.php?id=../etc/passwd ThinkPHP框架错误提示

系统发生错误
您可以选择 [ 重试 ] [ 返回 ] 或者 [ 回到首页 ]
[ 错误信息 ]

无法加载模块


日志也没更新 test.php?id=../etc/passwd  但是nginx也没报错 - -

军哥运维代购:http://shop63846532.taobao.com/

发表于 2019-6-9 09:48:23 | 显示全部楼层



每次醒来 发表于 2019-6-8 19:33
奇怪刚刚装好 test.php?id=../etc/passwd 是有提示防火墙拦截页面的

现在输入test.php?id=../etc/passwd  ...

ngx_lua_waf工作正常的话应该是会提示的

nginx上上不检测ngx_lua_waf上配置文件是否有错误的
发表于 2019-6-9 10:39:10 | 显示全部楼层

看看,学习一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-7-27 08:30 , Processed in 0.028992 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表