• 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

CONCAT columns with Laravel 5 eloquent

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Docker & Laravel : configure: error: Package requirements (oniguruma) were not met

Convert string to lowercase AND then convert it to its original form in PHP, is it possible?

"Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

PHPSpreadsheet - How Do I Use Auto Migration Tool

Get data from accuweather api url

Generate random username based on full name php

add_action() function in wordpress not working [duplicate]

Redirect to previous page with php

PHP - CURL using HTTPS [closed]

Form repeater send wrong data with last element in Laravel

Sum column values from multiple arrays

Laravel post contact form giving me error 419

About Contact Privacy policy Terms and conditions