samedi 30 avril 2016

How to check user agent in nginX config?

Is there a way to say if user agent contains a word like Android then do the rest?

I have a config like below:

valid_referers server_names;
if ($invalid_referer) {
   error_page 403 = @deny;
   return 403;
}

What I want to do is to say if there is an invalid referrer and user agent does not contain android then give the user 403. Is it possible? How to accomplish such a problem?

Aucun commentaire:

Enregistrer un commentaire