Jump to content

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


atesin

Recommended Posts

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...