• 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

Cut an arabic string

php 7 php.ini upload_max_filesize not working

How to redirect to another page after n seconds in wordpress without using javascript?

Querying only one row from a one to many relationship laravel

SendGrid: Sending an email to multiple recipients without other emails being shown on the "to" field

PHPExcel_IOFactory::createWriter causes wrong behaviour

Reading input in php from terminal

Laravel SQL query midnight time not showing

Wordpress how to get the post thumbnail inside a figure tag

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

How to prevent phpmailer sending embedded image as an attachment on Gmail?

How to fix this error : Ask your hosting provider to use PHP 7.2.5 or higher for both HTTP and CLI?

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

Testing subscription renewals on Stripe

About Contact Privacy policy Terms and conditions