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

c0nw0nk nginx-forum at
Thu Jan 29 14:20:36 UTC 2015

So i use nginx with PHP and i have the following two urls i want to allow
access on the subdomain.

The full url would be

if ( $args ~
'option=com_hwdmediashare&task=addmedia.upload([a-zA-Z0-9-_=&])' ) {


But i cant figure out in nginx how to block all other traffic/requests on
the subdomain apart from those two urls can anyone help me get a
understanding of the location block of nginx so i can block access to all
links apart from those two.

Posted at Nginx Forum:,256336,256336#msg-256336

More information about the nginx mailing list