nginx rules to deny php/perl execution

nfn nginx-forum at nginx.us
Sat Nov 20 22:50:14 MSK 2010


Hello again,

Just test some rules and after some testing I have this:

[code]
	location ~ ^/(cache|static|etc)/  {
      root /var/www;
      if ( $request_filename ~* "^.+\.(php|pl|php3|php4|php5)$" ) {
        return 403;
      }
	}
[/code]

Any advice?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,152089,152104#msg-152104




More information about the nginx mailing list