Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Protecting a file

$
0
0
Hi,

I want to protect a file lets say "abc.txt" in a path like "example.com/folder/abc.txt" from being read by users, actually i want only php to be able to access that file and if i put "example.com/folder/abc.txt" in my browser i get redirected to somewhere else or get an error.

How can I do this using nginx ? i've found some topics related to password protecting a folder but i don't want to do that i only want php to be able to access it and also i can not put the file outside of public root folder.

Thanks in advance

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>