Jump to content

how to hide files by extension, make apache/nginx send a 404?


Recommended Posts

Posted

hi.... in my home server, i invented a system that tracks ip addresses to avoid spam in html forms, ip's are written in include files hidden by nginx.. by extension

Quote

 location ~ \.(404|inc)$  {
     return 404;
}

  • .inc = i use these with php include, the inclusion and execution works despite the extension, but i want to hide direct download/execution for security
  • .dat = i use these files as little text databases/tables, for example to store csv-like data... i want to block direct viewing/downloading
  • .404, .hidden, etc = generic hidden files

... how could this be achieved server wide, here in heliohost??  ... or are files starting with dot hidden by webserver at least?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...