Problem
I'm trying to set-up a private file directory for Drupal on an LEMP stack (Ubuntu 12.04, nginx, MySQL, PHP), I wasn't 100% sure about the permissions or set-up so I thought I'd ask, how should you do it?
So Far
It needs to be a folder which is writable by the webserver but not accessible from the web.
Example:
Location: drupal_root/privatefiles
Permission: chgrp 775 www-data privatefiles
Nginx config: (goes into /etc/nginx/sites-available/mysite
):
server {
listen 8080;
root /srv/www/mysite/public;
location ^~ /privatefiles {
internal;
}
...
}
Would that be enough? It recommends on the official page to have the folder outside the Drupal root. What difference would this make?