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

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    1:00 AM
    Nginx-1.25.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