How to configure Drupal 7 to have private files folder. And also this configuration is secure within Nginx config.

1 Answer 1


To set up a private files folder, navigate to: Administration » Configuration » Media » File system. Create a path from the Unix root for the "Private file system path" (e.g. /var/files) outside of the Drupal root.

Make sure that this folder is readable and writable by the web server user.

By having this folder outside of the Drupal root, it is secure. It cannot be compromised through the web server.

  • Thanks for the answer. So can I use "/var/files" for the creation in Private file system path or there's a certain or exact config? Thanks again! Oct 7, 2018 at 19:38
  • Yes, the gist of the answer is that you can use /var/files (or any other path that is outside of the Drupal root) as the private file system path. There is no exact config , the path /var/files is just the one I happen to use myself. Oct 8, 2018 at 8:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.