Block direct access to .inc files not working

Dewangga Alam dewanggaba at xtremenitro.org
Sat Feb 20 09:21:50 UTC 2016


Hello!

On 2/20/2016 4:07 PM, rsclmumbai wrote:
> I've a nginx server on CentOS with PHP setup.
> I'm trying to block direct access to .inc files
>
> I've added the following to nginx.conf
>
> 			location ~ /\.inc
> 			{
> 				deny all;
> 			}
>

Have you try :

location ~ \.inc {
      deny all;
}

> & restarted nginx.
>
> But I still able to access .inc files like
> https://mydomain,com/includes/config.inc
>
> Pls suggest what I may be missing or how else to fix this issue. I Need to
> block access to all .inc files.
>
> Thanks
> Sans
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,264663,264663#msg-264663
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list