0

I'm trying to return 400 status if someone includes this character '<' anywhere in the url request, for example the request might look like

https://example.com/adfg<script

I tried the following in Nginx location block, but obviously this is not how it works,

location /*<* {
      return 400;
}

What's the right syntax that i need to write please.

Adam
  • 21
  • 1
  • 3

1 Answers1

0

"<" characters is not allowed in a url. Therefore you can't use it, maybe you want to use the url encoded version: "%3C".

Check: Characters allowed in a URL

Blackarrow
  • 36
  • 1
  • 3
  • Ok great, and how would i write the location block please for '%3C' if it came anywhere in the url – Adam Apr 09 '21 at 07:17