Want to subscribe to topics you're interested in?
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 Well-Known Member

    4,022
    421
    83
    May 31, 2014
    Ratings:
    +816
    Local Time:
    5:10 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