regex - How do I redirect all requests that does NOT contain certain string to 400 using nginx -


I am trying to block or redirect all types of requests, which do not include some strings or keywords in Yuri. I am looking for a solution using NGNX. Especially if "not wired wire" is not possible! (Node) matching, there is no alternative.

I would recommend using a map:

  map Starting by assuming $ uri $ bad_request {# this is a bad request default 1; #If any of the following matches, clean the $ bad-request variable ~ e-required string 0; ~ Required-string 0; # ...} location / {if ($ bad_request) {return 400; }}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -