Join the community today
Register Now

Nginx Block code from running on a folder in Nginx

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Jan 24, 2015.

Tags:
  1. pamamolf

    pamamolf Well-Known Member

    2,725
    243
    63
    May 31, 2014
    Ratings:
    +434
    Local Time:
    11:45 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    How can i add on this code more extensions so i can block more evil files from running code in this folder that should allow only images to be served from there and never run any other type of files?

    Code:
    location ~^(/uploads/).*(\.php)$ {
    deny all;
    }
    Thanks