Answer the question
In order to leave comments, you need to log in
How to generate a regular expression for nginx?
It is necessary to return 403 if the length value of key !=6 and contains something other than numbers / letters
The last attempt was like this:
map $request_uri $blocker {
"~ !^/status/?key=([0-9a-zA-Z]{6})$" "1";
}
if ($blocker) { return 403;}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question