Welcome to Centmin Mod Community
Become a Member

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 Premium Member Premium Member

    3,405
    320
    83
    May 31, 2014
    Ratings:
    +608
    Local Time:
    10:16 AM
    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