Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

how to deny access to scripts in some directories

$
0
0
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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>