【问题标题】:How to block libwww-perl access via .htaccess in nginx server如何在 nginx 服务器中通过 .htaccess 阻止 libwww-perl 访问
【发布时间】:2017-11-10 08:34:29
【问题描述】:

我熟悉 Apache 服务器,但对 Nginx 服务器很陌生,这就是为什么我对如何阻止 libwww-perl 访问有点困惑。 在 Apache 服务器中,我使用了这段代码

 RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
 RewriteRule .* ? [F,L]

【问题讨论】:

    标签: .htaccess nginx server


    【解决方案1】:

    在 HTTP 部分中,添加以下行:

    # 常见的带宽占用者和黑客工具。

      if ($http_user_agent ~ "libwww-perl") {
        return 403;
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-18
      • 2023-04-09
      • 1970-01-01
      • 2023-04-08
      • 2019-03-17
      • 1970-01-01
      • 1970-01-01
      • 2019-05-16
      相关资源
      最近更新 更多