Welcome! Log In Create A New Profile

Advanced

Re: Passing / denying PHP requests

Francis Daly
October 23, 2013 02:42PM
On Wed, Oct 23, 2013 at 11:32:33AM -0700, Paul N. Pace wrote:
> On Wed, Oct 23, 2013 at 9:49 AM, Francis Daly <francis@daoine.org> wrote:

Hi there,

> "location ~ php$ { deny all; }" does not deny access to any php files,
> even when nested in "location ^~ /installdirectory/ {}". The previous
> configuration "location ~* installdirectory/.*\.php$ { deny all; }"
> did block access to all php files. The ".*\." - is that why one works
> and the other doesn't?

I suspect not.

What "location" lines do you have in the appropriate server{} block in
your config file?

What one request do you make?

From that, which one location{} block is used to handle this one request?

> > http://nginx.org/r/location for how the one location{} is chosen to
> > handle a request.
>
> I read through the nginx.org explanation of the location directive,
> but it isn't helping me with understanding how to build the deny
> statement.

Do whatever it takes to have these requests handled in a known location{}
block.

Put the config you want inside that block.

If you enable the debug log, you will see lots of output, but it will tell
you exactly which block is used, if it isn't clear from the "location"
documentation.

Cheers,

f
--
Francis Daly francis@daoine.org

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

Passing / denying PHP requests

openletter October 23, 2013 10:32AM

Re: Passing / denying PHP requests

Francis Daly October 23, 2013 12:50PM

Re: Passing / denying PHP requests

openletter October 23, 2013 02:34PM

Re: Passing / denying PHP requests

Francis Daly October 23, 2013 02:42PM

Re: Passing / denying PHP requests

openletter October 25, 2013 05:46PM

Re: Passing / denying PHP requests

Francis Daly October 26, 2013 08:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 189
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