• 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

Symfony run hint kernel.secret parameter not found

PHP Array split string and Integers

Project structure for PHP

Laravel no logout option from menu after successfull login

Select option from dropdown menu with PHP and mySql

Get lat/lon from google maps url ftid (hex)

laravel MVC execution flow

PHPExcel export HTML table to xlsx

shell errors running php exec

Transfer data between JavaScript and PHP through JSON

How to insert data from multiple select dropdown values into database?

How to create a cookie to store the timestamp of when a page is first loaded with php

Display Brand Name Above Product Title in Woocommerce Cart, Checkout Page, Orders and Email Notification

Nginx RTMP not recording

How to create laravel storage symbolic link for production or sub domain system?

About Contact Privacy policy Terms and conditions