Welcome! Log In Create A New Profile

Advanced

Re: nginx rules to deny php/perl execution

António P. P. Almeida
November 20, 2010 02:24PM
On 20 Nov 2010 19h00 WET, appa@perusio.net wrote:

> On 20 Nov 2010 18h39 WET, nginx-forum@nginx.us wrote:
>
>> Hello,
>>
>> I have some directories (cache, static, etc) that denies execution
>> of some files. In these directories I have a .htaccess file with
>> this rule:
>>
>>
>> Order allow,deny
>> Deny from all
>>
>>
>> I would like to test nginx with php-fpm but I don't know how to
>> rewrite these rules in nginx Can someone help me?

Also add this as your *last* location directive:

location ~* \.(?:php|pl)$ {
return 404; # or 403 if you prefer.
}

Note that you should have defined the locations where it's "legal" to
handle PHP and Perl before.

--- appa


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

nginx rules to deny php/perl execution

nfn November 20, 2010 01:39PM

Re: nginx rules to deny php/perl execution

António P. P. Almeida November 20, 2010 02:08PM

Re: nginx rules to deny php/perl execution

António P. P. Almeida November 20, 2010 02:24PM

Re: nginx rules to deny php/perl execution

nfn November 20, 2010 02:31PM

Re: nginx rules to deny php/perl execution

nfn November 20, 2010 02:50PM

Re: nginx rules to deny php/perl execution

nfn November 20, 2010 03:05PM

Re: nginx rules to deny php/perl execution

nfn November 20, 2010 05:27PM

Re: nginx rules to deny php/perl execution

António P. P. Almeida November 20, 2010 02:56PM

Re: nginx rules to deny php/perl execution

António P. P. Almeida November 20, 2010 03:14PM

Re: nginx rules to deny php/perl execution

António P. P. Almeida November 20, 2010 03:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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