• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Nginx disallowing execution of PHP in uploads directory with Magento

phpmagentonginxcentos


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

Related Snippets

PhP how to calculate moments with variables rows

php script to delete files older than 24 hrs, deletes all files

Woocommerce Checkout - Add conditional field required if one field is filled

Laravel s3 upload file with metadata using pre-signed url

Nginx RTMP not recording

PHPExcel_IOFactory::createWriter causes wrong behaviour

How do I Post to .txt document before form submits

is there any way to validate a field that sometime is File(image) && sometime is String(Src of same image)

Facebook API, get page post link (PHP)

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: 'column_name' in Laravel

Laravel phpunit test failing authorization

oauth-private.key does not exist or is not readable

How can i hide dt if dd got empty value

Laravel multi auth - Authentication user provider [] is not defined

Docker image build with PHP zip extension shows "bundled libzip is deprecated" warning

About Contact Privacy policy Terms and conditions