关于waf安装的到web反代的问题
安装完,默认的IP测试没问题,然后我再测试加到nginx反代中,好像不行~~~~
下面配置贴 图
这个是默认的nginx,通过IP访问的,是测试通过的,
由于附件图片过大,下面贴 代码
<blockquote>server代码上面,我感觉没配错,网页上域名后加
http://域名/test.php?id=../etc/passwd 来测试
直接跳404,这是什么鬼,是不是配置失败了
nginx.conf配置文件
userwww www;
worker_processes auto;
worker_cpu_affinity auto;
error_log/home/wwwlogs/nginx_error.logcrit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept off;
accept_mutex off;
}
http
{
include mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
upstream myserver {
ip_hash;
server IP:443;
}
sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
proxy_cache_path /data/bimg levels=1:2 keys_zone=bimg:500m inactive=120m max_size=5g;
proxy_cache_path /data/s levels=1:2 keys_zone=s:500m inactive=120m max_size=5g;
proxy_cache_valid 200 304 302 24h;
include proxy.conf;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE \.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
lua_package_path "/usr/local/nginx/conf/waf/?.lua";
lua_shared_dict limit 10m;
init_by_lua_file /usr/local/nginx/conf/waf/init.lua;
access_log on;
server
{
listen 80 default_server reuseport;
#listen [::]:80 default_server ipv6only=on;
server_name _;
index index.html index.htm index.php;
root/home/wwwroot/default;
access_by_lua_file /usr/local/nginx/conf/waf/waf.lua;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/access.log;
}
include vhost/*.conf;
}
vhost/web.conf
server {
listen 80;
server_namewww.xxxxx.com;
rewrite ^(.*) https://$host$1 permanent;
}
server
{
listen 443 ssl;
server_name www.xxxxx.com;
root /www/web/;
access_by_lua_file /usr/local/nginx/conf/waf/waf.lua;
ssl_certificate ssl/www.xxxxx.com.crt;
ssl_certificate_key ssl/www.xxxxx.com.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location ~/* {
proxy_set_header Host www.xxxxx.com;
proxy_pass https://myserver;
indexindex.php index.html index.htm;
proxy_cache www.xxxxx.com;
proxy_cache_valid 200 20m;
}
include guize/zhizhu.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log /www/log/www.xxxxx.com.log;
}
test.php不存在的话是无法测试的,没有test.php ,你看看你网站根目录下有什么.php的文件,一般 index.php 肯定有吧,有就替换为 index.php 进行测试 licess 发表于 2023-4-21 08:07
test.php不存在的话是无法测试的,没有test.php ,你看看你网站根目录下有什么.php的文件,一般 index.php...
这个lua的功能 ,是不是不支持html,不支持恶意采集访问之类的。 zhuzhu0628 发表于 2023-4-21 21:17
这个lua的功能 ,是不是不支持html,不支持恶意采集访问之类的。
有防cc的功能
CCrate = "100/60"
--设置cc攻击频率,单位为秒.
--默认1分钟同一个IP只能请求同一个地址100次
满足触发条件就可以
或者useragent之类的有明显特征也可以加上
页:
[1]