• 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

Testing subscription renewals on Stripe

Don't show recurring price for WooCommerce subscriptions worth 0$

Sum array values of a column within each column of an array with 3 levels

How to pass security cloudflare server with php curl

How to change HTML structure inside WP <head>

Composer fails with kylekatarnls/update-helper on new homestead

JSON Render Issue in Date Object Laravel and PHP 7.4

Laravel : How to Create Dropdown to Select FOREIGN KEY from Other Table?

Increase value by 1 on button click

Yii2 select2 database exception number of bound variables does not match number of tokens

Laravel insert dynamic input values with radio button

PHPExcel export HTML table to xlsx

Generate random username based on full name php

How to get array values using foreach in laravel

How to submit a form when page loads using JavaScript?

About Contact Privacy policy Terms and conditions