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