Nginx with php configuration how to block all requests/urls other than two?

itpp2012 nginx-forum at nginx.us
Thu Jan 29 15:09:24 UTC 2015


Use map,

map $request $allowonly {
    default                                 1;
    ~*addmedia\.upload([a-zA-Z0-9-_=&])   0;                             
1;
}

inside location {} if ($allowonly) { return 404; }

Untested but should give you enough to test with.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,256336,256337#msg-256337



More information about the nginx mailing list