title: Prevent PHP from accessing the parent directory
body: <p>I have a website hosted in the directory: <code>/var/www/website.com</code>. </p>
  
  <p>This directory and all its subfolders <strong>allow</strong> the execution of PHP code. However, I would like to <strong>prevent</strong> the PHP files that are in a specific folder (<code>/var/www/website.com/subfolder</code>) from accessing the parent folder and listing its files.</p>
  
  <p>Example: a PHP function like <a href="http://php.net/manual/en/function.scandir.php" rel="nofollow"><code>scandir()</code></a> should be allowed to list all folders, subfolders and files that are in (<code>/var/www/website.com/subfolder</code>), but should <strong>NOT</strong> be allowed to list files <strong>below</strong> that level.</p>
  
  <p>Do you know how a behavior like this could be implemented (with Nginx preferably)?</p>