Nginx disallowing execution of PHP in uploads directory with Magento
PHP Snippet 1:
## Location for media to prevent execution of php
location ^~ /media/ {}
PHP Snippet 2:
location ~ [^/]\.php(/|$) {
PHP Snippet 3:
location ~* /your_directory/.*\.php$ {
return 503;
}
PHP Snippet 4:
location /media/ {
......
# Banned locations
location ~* (\.php$|\.phtml$|\.htaccess$|\.git) {
deny all;
}
}