Deny access per extension in multiple locations

nfn nginx-forum at
Thu Oct 7 20:07:59 MSD 2010


I have this rule in apache that denies access to some extensions in
multiple locations.
I have this .htaccess in some folders like uploads, docs, pdfs.

    Order allow,deny
    Deny from all

How can I join this in one line to deny access in multiple folders for
these extensions?

I was trying this without success:

location ~ /(uploads/|docs/|pdfs/)*\.(php|cgi|pl|php3|php4|php5)$ {
  root /srv/www/;
  deny    all;


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

More information about the nginx mailing list