Welcome! Log In Create A New Profile

Advanced

Re: Deny access per extension in multiple locations

Francis Daly
October 07, 2010 06:10PM
On Thu, Oct 07, 2010 at 12:07:59PM -0400, nfn wrote:

Hi there,

> 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/portaldasviagens.com/public;
> deny all;
> }

Turn on "error_log" with "debug", then try to access one of the urls
you want to have denied. Look for the log lines with "test location:"
and "using configuration". That will tell you which location block is
being used for each request.

I suspect that the above regular expression does not match the locations
you want it to match. Specifically, the "*" probably wants a "." before
it.

Good luck,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Deny access per extension in multiple locations

nfn October 07, 2010 12:07PM

Re: Deny access per extension in multiple locations

António P. P. Almeida October 07, 2010 12:44PM

Re: Deny access per extension in multiple locations

António P. P. Almeida October 07, 2010 12:48PM

Re: Deny access per extension in multiple locations

Francis Daly October 07, 2010 06:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 295
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready