• 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 Startup: Unable to load dynamic library 'openssl' in Ubuntu

CSV to PHP class properties

SQLSTATE[HY000]: General error: 1 table posts has no column named *

How to send upload image through email

php retrieve specific data onclick from database in a list format

PHP drop down list using array's and foreach (else and for) code

sort() not affecting original array while inside foreach loop

How to KeyBy where multiple items have the same key

Pagekite error: FAIL: localhost:8080 is down

Custom add to cart button URL for specific product in WooCommerce?

How to convert a carbon into string, to take the date only?

How to render html from a @foreach loop in a textarea

Is it possible to change the table name in the migration file-laravel

PHP date() with timezone?

Download & Save Zoom Recording in directory by PHP

About Contact Privacy policy Terms and conditions