全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 5674|回复: 15

宝塔防火墙什么原理

[复制链接]
发表于 2018-8-7 21:34:44 | 显示全部楼层 |阅读模式
收费插件宝塔防火墙,没看见nginx加载宝塔防火墙相关插件,也没使用代理功能,怎么就能过滤http呢

  1. user  www www;
  2. worker_processes auto;
  3. error_log  /www/wwwlogs/nginx_error.log  crit;
  4. pid        /www/server/nginx/logs/nginx.pid;
  5. worker_rlimit_nofile 51200;

  6. events
  7.     {
  8.         use epoll;
  9.         worker_connections 51200;
  10.         multi_accept on;
  11.     }

  12. http
  13.     {
  14.         include       mime.types;
  15.         include proxy.conf;
  16.         include luawaf.conf;

  17.         default_type  application/octet-stream;

  18.         server_names_hash_bucket_size 128;
  19.         client_header_buffer_size 32k;
  20.         large_client_header_buffers 4 32k;
  21.         client_max_body_size 50m;

  22.         sendfile   on;
  23.         tcp_nopush on;

  24.         keepalive_timeout 60;

  25.         tcp_nodelay on;

  26.         fastcgi_connect_timeout 5000;
  27.         fastcgi_send_timeout 5000;
  28.         fastcgi_read_timeout 5000;
  29.         fastcgi_buffer_size 64k;
  30.         fastcgi_buffers 4 64k;
  31.         fastcgi_busy_buffers_size 128k;
  32.         fastcgi_temp_file_write_size 256k;
  33.                 fastcgi_intercept_errors on;

  34.         gzip on;
  35.         gzip_min_length  1k;
  36.         gzip_buffers     4 16k;
  37.         gzip_http_version 1.1;
  38.         gzip_comp_level 2;
  39.         gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  40.         gzip_vary on;
  41.         gzip_proxied   expired no-cache no-store private auth;
  42.         gzip_disable   "MSIE [1-6]\.";

  43.         limit_conn_zone $binary_remote_addr zone=perip:10m;
  44.                 limit_conn_zone $server_name zone=perserver:10m;

  45.         server_tokens off;
  46.         access_log off;

  47. server
  48.     {
  49.         listen 888;
  50.         server_name www.bt.cn;
  51.         index index.html index.htm index.php;
  52.         root  /www/server/phpmyadmin;

  53.         #error_page   404   /404.html;
  54.         include enable-php.conf;

  55.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  56.         {
  57.             expires      30d;
  58.         }

  59.         location ~ .*\.(js|css)?$
  60.         {
  61.             expires      12h;
  62.         }

  63.         location ~ /\.
  64.         {
  65.             deny all;
  66.         }

  67.         access_log  /www/wwwlogs/access.log;
  68.     }
  69. include /www/server/panel/vhost/nginx/*.conf;
  70. }

复制代码


include luawaf.conf; 是空内容
include /www/server/panel/vhost/nginx/*.conf;  也没加载相关防火墙配置


Nginx 编译也没什么特殊
  1. nginx version: nginx/1.12.1
  2. built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
  3. built with OpenSSL 1.0.2l  25 May 2017
  4. TLS SNI support enabled
  5. configure arguments: --user=www --group=www --prefix=/www/server/nginx --with-openssl=/www/server/nginx/src/openssl --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream --with-stream_ssl_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E
复制代码
发表于 2018-8-7 22:00:39 | 显示全部楼层
        include       mime.types;
        include proxy.conf;
        include luawaf.conf;
这几个 看看.
发表于 2018-8-7 21:36:14 来自手机 | 显示全部楼层
我第一个吗
发表于 2018-8-7 21:38:11 | 显示全部楼层
同好奇,即使宝塔开了端口,还得在gcp后台放行。。不知道其他家的是不是这样
发表于 2018-8-7 21:48:09 | 显示全部楼层
本帖最后由 cicvc 于 2018-8-7 21:49 编辑

include luawaf.conf;这个文件发一下
好吧,看到是空文件了,讲道理,我就觉得这个问题有点问题
发表于 2018-8-7 21:49:50 | 显示全部楼层
mushan099 发表于 2018-8-7 21:38
同好奇,即使宝塔开了端口,还得在gcp后台放行。。不知道其他家的是不是这样 ...

哈哈哈 你这是纯小白   
liusu 该用户已被删除
发表于 2018-8-7 23:06:13 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2018-8-7 23:41:32 | 显示全部楼层
各位大佬找到了,原来是在  [/www/server/panel/vhost/nginx/btwaf.conf] 里
lua_shared_dict btwaf 20m;
lua_shared_dict drop_ip 10m;
lua_shared_dict drop_sum 10m;
lua_package_path "/www/server/btwaf/?.lua";
init_by_lua_file  /www/server/btwaf/init.lua;
access_by_lua_file /www/server/btwaf/waf.lua;
 楼主| 发表于 2018-8-8 00:01:29 | 显示全部楼层
liusu 发表于 2018-8-7 23:06
nginx_lua_waf

其实就是开源东西套个壳,不要脸的说自家研发的

一点没错还是 nginx_lua_waf
发表于 2018-8-8 00:06:38 | 显示全部楼层
觉得自己几个小时挣不到10块钱的可以自己编译 每个机器都编译配置。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-12-4 12:58 , Processed in 0.101559 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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