Learn about Centmin Mod LEMP Stack 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

    4,003
    420
    83
    May 31, 2014
    Ratings:
    +812
    Local Time:
    3:16 PM
    Nginx-1.17.x
    MariaDB 10.3.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