Welcome! Log In Create A New Profile

Advanced

Passing / denying PHP requests

October 23, 2013 10:32AM
Hello-

I am trying to allow only the PHP files required for a given PHP
package to function correctly, then deny access to all other PHP files
to prevent people from snooping on the site's configuration. I have
created the location block, but I'm not so good with regular
expressions and the block is assembled mostly through copy & paste.

location /installdirectory/ {
# from nginx pitfalls page
location ~*
(installdirectory/file_a|installdirectory/file_b|installdirectory/file_c)\.php$
{
include global-configs/php.conf;
}
location ~* installdirectory/.*\.php$ {
deny all;
}
}

If someone can let me know if I am at least on the right track, I
would appreciate it.

Thanks!

Paul

_______________________________________________
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: 232
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