Welcome! Log In Create A New Profile

Advanced

how to deny access to scripts in some directories

Posted by digrouz 
how to deny access to scripts in some directories
August 08, 2013 06:35AM
Hi,

I'm running nginx with php-fpm and a lot of application. I would like to secure my installation by denying access to scripts in some directories and I'm not able to achieve it, can anyone help me?

For example I use the following for joomla which is installed in a folder named "magic" under the root of the webserver.
This is not working and I don't understand why...

# deny running scripts inside writable directories
location ~* /magic/.(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
deny all;
}

location ~ /\. {
deny all;
}

location /magic {
expires 1d;
try_files $uri $uri/ /magic/index.php?$args;
}


Thanks in advance
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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