search

Home  >  Q&A  >  body text

php - How to use nginx rules to block a certain URL from being brushed

1. From the website statistics, we can see that there are many visits to external links, resulting in a high bounce rate of the website. The target link is: http://rm.leyutuan.com/tt/wll..., this page will Jump to a php file;
2. How to implement rule blocking for such brushing behavior?

Please help the experts analyze and give solutions. The server environment is cetos nginx.

给我你的怀抱给我你的怀抱2715 days ago910

reply all(3)I'll reply

  • 滿天的星座

    滿天的星座2017-06-21 10:13:13

    In the nginx configuration file, the server area

    if ( $http_referer ~ "leyutuan.com" ){
        return 403;
    }

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-21 10:13:13

    Effective, thank you very much!

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-21 10:13:13

    My website has been maliciously requested before. I used iptables to block the URL.
    iptables -t raw -A PREROUTING -i eth0 -p tcp --dport 80 -m string --from 0 --to 100 --algo bm --string "GET /ddos_url/" -j DROP
    roughly means: If the 0--100 characters of the request packet include "GET /ddos_url/", then it will be intercepted. In this case, any request for that URL will be blocked by the firewall.
    iptables-nvL -t raw View the number of intercepted requests.

    reply
    0
  • Cancelreply