• 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

How can I easily switch between PHP versions on Mac OSX?

Unable to uninstall brew php from homebrew

How to get quarter for future date using Carbon?

How to install php yaml on CentOs?

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Whats the point of running Laravel with the command 'php artisan serve'?

PHP Find Array Index value in multi-line array

how to remove %20 in the url in php

php retrieve specific data onclick from database in a list format

javascript html popup window

Hide specific products from unlogged users based in product category in WooCommerce

I want a way to give path to my files which are outside of public folder in laravel

PHP block shortcut in Visual Studio Code

Send POST data via raw JSON with Postman

Reducing authentication calls on external API (Laravel 5.6)

About Contact Privacy policy Terms and conditions