• 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

Not able to override collapsible.js in magento 2

How to loop a tree array with unknown depth and get array blocks?

how to youtube api data to print in toolset metabox using a button click before save-post

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

Display specific shipping method if woocommerce product has specific acf field value

target [LaravelFortifyContractsRegisterViewResponse] is not instantiable

PHP: set a (deep) array key from an array [closed]

woocommerce change position of price

Can I write PHP code across multiple lines per statement?

array_key_exists(): The first argument should be either a string or an integer

Google Calendar API batch request PHP

Laravel 5 issue with wherePivot

PHP array slice from position + attempt to return fixed number of items

Assign output of PHP function to a variable

httpd.conf on Windows: can't locate API model structure `php8_module`

About Contact Privacy policy Terms and conditions