Restrict unwanted calls to the Server

2019-09-11 02:12发布

问题:

We have a B2C application. We have some URL's that are not secure and some scripts are continuously hitting that URL's.

Precondition:

  1. We don't want to implement security on that URL's.
  2. We don't want to use Captcha

I have a Public url easily accessible to all users, behind the scene that url is accessing some service. Now i am getting unexpected users on my public url that are using my services for their personal sake. I don't want to add security on my services. I want to restrict those user's on the basis of IP address or some other mechanism. That's easy to block static IP's but i am not sure how to restrict dynamic IP's. Please help.

回答1:

I can think of one quick solution : You can limit the number of requests from a single IP Address at web server level.

For example, if you are using Apache, below configuration will take care of it.

<Directory /home/*/public_html> -- You can change this location
    MaxConnPerIP 1  
    OnlyIPLimit audio/mpeg video
</Directory>

You can visit this link for more details :Limit Requests for IP

Any webserver will provide this type of feature with a different configuration or rule set