How to block user-agents in Plesk Control Panel on Windows?

Started by Suhitha, Aug 08, 2025, 05:00 AM

Previous topic - Next topic

Suhitha

Question
How to block user-agents in Plesk Control Panel on Windows?
Answer

Choose a method that suites you most:


                  Using Filtering Rules on IIS

  • To block these agents on IIS use the following steps:
  • Open the IIS Manager
  • Navigate to the level that you want to block the request (use the top level to apply it to the entire server)
  • Click on Request Filtering (in IIS part)
  • Click on the Filters Tab, then click on Add filtering rule... in the Action panel on the right
  • Configure the tab as follows:
  •     Define a name for the rule, in this example is "user-agent"
  •     In the Scan Header field, add the value "user-agent"
  •     In the Deny Strings field, add the values of the user-agents that must be blocked, one per line. In the example, is blocking the user-agents "hello" and "world"
  • You should add closer to this:
  • Press OK and make a non-redirect following query with a specified user agent. Now it will return 404:
  • Add the following configuration (where hello, world and helloworld are case-insensitive:
# curl -Ik 10.69.45.153:8880 -A hello
HTTP/1.1 404 Not Found
Content-Length: 929
Content-Type: text/html
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
X-Content-Type-Options: nosniff
Date: Tue, 25 Mar 2025 14:47:08 GMT
Connection: close