Home  >  Q&A  >  body text

How to configure nginx to block userAgent with '\' transfer character?

As the title says, there is a useAgent:

"Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html\xA3\xA9"

Block the userAgent in nginx configuration, written as:

Mozilla/5.0\ \(compatible;\ Baiduspider/2.0;\ +http://www.baidu.com/search/spider.html\xA3\xA9

But it is invalid. The xA3xA9 behind it seems to have been automatically escaped.

How should I write to block this userAgent?

ringa_leeringa_lee2691 days ago571

reply all(1)I'll reply

  • 阿神

    阿神2017-05-16 17:12:47

    \\

    reply
    0
  • Cancelreply