Operating System & Version
CentOS 7.6
cPanel & WHM Version
92

c0i0t3

Well-Known Member
Sep 30, 2005
65
2
158
Hospedagem de Site
I use the codes below to block access from improper links to image and mp4 files:

NGINX:
location ~* .*\.mp4 {
        valid_referers none blocked dominio1.com www.dominio1.com dominio2.com www.dominio2.com;
                if ($invalid_referer) {
                return   403;
        }
        expires 365d;
            mp4;
        }
Block access to a particular folder:

NGINX:
location ~* \.(mp4)$ {
         root           /home/admin/web/dominio.com/public_html;
         valid_referers none blocked dominio.com www.dominio1.com;
         if ($invalid_referer) {
         return   403;
           }
        }
I hope the information is useful.