• 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 to fix bootstrap multiselect search data using ajax

how to display a view on laravel 8 and not have a 404 NOT FOUND page?

Send same name multiple checkbox values via ajax

How to get multiple values with same key from an array PHP

Laravel php artisan serve to mimic HTTPS

User pool client {id}does not exist

PHP SoapClient: set a namespace without prefix

Attempt to read property "view" on null when sending password reset email

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

How to set dynamic `home` and `siteurl` in WordPress?

Sentry + Laravel: how to log an already catched Exception?

Object of class stdClass could not be converted to string error

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

How can I make this nested location configuration use the correct path to call a php program?

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

About Contact Privacy policy Terms and conditions