当前位置:论坛首页 > Linux面板 > 求助

【已解答】宝塔Nginx配置规则错误

发表在 Linux面板2022-7-22 23:34 [复制链接] 6 7870

错误信息:
QQ截图20220722233740.png
btwaf.conf文件
  1. lua_shared_dict spider 10m;
  2. lua_shared_dict btwaf 30m;
  3. lua_shared_dict drop_ip 30m;
  4. lua_shared_dict drop_sum 30m;
  5. lua_shared_dict btwaf_data 100m;
  6. lua_package_path "/www/server/btwaf/?.lua";
  7. init_by_lua_file  /www/server/btwaf/init.lua;
  8. access_by_lua_file /www/server/btwaf/waf.lua;
  9. header_filter_by_lua_file /www/server/btwaf/header.lua;
  10. body_filter_by_lua_file /www/server/btwaf/body.lua;
复制代码
nginx.conf文件
  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. stream {
  7.     log_format tcp_format '$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_received|$session_time|$upstream_addr|$upstream_bytes_sent|$upstream_bytes_received|$upstream_connect_time';
  8.   
  9.     access_log /www/wwwlogs/tcp-access.log tcp_format;
  10.     error_log /www/wwwlogs/tcp-error.log;
  11.     include /www/server/panel/vhost/nginx/tcp/*.conf;
  12. }

  13. events
  14.     {
  15.         use epoll;
  16.         worker_connections 51200;
  17.         multi_accept on;
  18.     }

  19. http
  20.     {
  21.         include       mime.types;
  22.                 #include luawaf.conf;

  23.                 include proxy.conf;

  24.         default_type  application/octet-stream;

  25.         server_names_hash_bucket_size 512;
  26.         client_header_buffer_size 32k;
  27.         large_client_header_buffers 4 32k;
  28.         client_max_body_size 50m;

  29.         sendfile   on;
  30.         tcp_nopush on;

  31.         keepalive_timeout 60;

  32.         tcp_nodelay on;

  33.         fastcgi_connect_timeout 300;
  34.         fastcgi_send_timeout 300;
  35.         fastcgi_read_timeout 300;
  36.         fastcgi_buffer_size 64k;
  37.         fastcgi_buffers 4 64k;
  38.         fastcgi_busy_buffers_size 128k;
  39.         fastcgi_temp_file_write_size 256k;
  40.                 fastcgi_intercept_errors on;

  41.         gzip on;
  42.         gzip_min_length  1k;
  43.         gzip_buffers     4 16k;
  44.         gzip_http_version 1.1;
  45.         gzip_comp_level 2;
  46.         gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  47.         gzip_vary on;
  48.         gzip_proxied   expired no-cache no-store private auth;
  49.         gzip_disable   "MSIE [1-6]\.";

  50.         limit_conn_zone $binary_remote_addr zone=perip:10m;
  51.                 limit_conn_zone $server_name zone=perserver:10m;

  52.         server_tokens off;
  53.         access_log off;

  54. server
  55.     {
  56.         listen 888;
  57.         server_name phpmyadmin;
  58.         index index.html index.htm index.php;
  59.         root  /www/server/phpmyadmin;

  60.         #error_page   404   /404.html;
  61.         include enable-php.conf;

  62.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  63.         {
  64.             expires      30d;
  65.         }

  66.         location ~ .*\.(js|css)?$
  67.         {
  68.             expires      12h;
  69.         }

  70.         location ~ /\.
  71.         {
  72.             deny all;
  73.         }

  74.         access_log  /www/wwwlogs/access.log;
  75.     }
  76. include /www/server/panel/vhost/nginx/*.conf;
  77. }

复制代码

使用道具 举报 只看该作者 回复
发表于 2022-7-23 00:04:25 | 显示全部楼层
重装后变 QQ截图20220722233740.png

系统:Red Hat Enterprise Server 7.9 (Maipo) aarch64(Py3.7.8)

一摸一样  发表于 2022-8-28 15:44
使用道具 举报 回复 支持 1 反对 0
发表于 2022-7-22 23:36:55 | 显示全部楼层
  1. nginx: [emerg] unknown directive "lua_shared_dict" in /www/server/panel/vhost/nginx/btwaf.conf:1
复制代码
使用道具 举报 回复 支持 反对
发表于 2022-7-23 00:03:20 | 显示全部楼层
堡塔安全木兰 发表于 2022-7-22 23:59
什么系统安装的宝塔面板呢?什么架构的?

报错原因是:系统缺少luajit组件,导致nginx使用异常;

重新安装后变成这个了 QQ截图20220722233740.png

系统是:Red Hat Enterprise Server 7.9 (Maipo) aarch64(Py3.7.8)
使用道具 举报 回复 支持 反对
发表于 2022-11-8 19:13:41 | 显示全部楼层
宝塔用户_huuudv 发表于 2022-7-23 00:03
重新安装后变成这个了

系统是:Red Hat Enterprise Server 7.9 (Maipo) aarch64(Py3.7.8)

您好,卸载防火墙后重新编译安装nginx试试
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

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