title: nginx serving 404 pages
body: <p>EDIT: Based on @Devons advice I ran the following commands with no errors (<a href="https://superuser.com/questions/91935/how-to-chmod-all-directories-except-files-recursively">found in this post</a>):</p>
  
  <pre><code>$ sudo find /var/public/www -type d -exec chmod 755 {} +
  
  $ sudo find /var/public/www -type f -exec chmod 644 {} +
  </code></pre>
  
  <p>But when I list the files inside www the permissions still look wrong. What am I doing wrong? Thanks!</p>
  
  <pre><code>drwxrwx--- 1 root vboxsf   4096 Aug 28 12:45 app
  -rwxrwx--- 1 root vboxsf   1646 Aug 28 12:45 artisan
  drwxrwx--- 1 root vboxsf      0 Aug 28 12:45 bootstrap
  -rwxrwx--- 1 root vboxsf   1201 Aug 28 12:45 composer.json
  -rwxrwx--- 1 root vboxsf 105046 Aug 28 12:55 composer.lock
  drwxrwx--- 1 root vboxsf   4096 Aug 28 12:45 config
  drwxrwx--- 1 root vboxsf      0 Aug 28 12:45 database
  -rwxrwx--- 1 root vboxsf    503 Aug 28 12:45 gulpfile.js
  -rwxrwx--- 1 root vboxsf    159 Aug 28 12:45 package.json
  -rwxrwx--- 1 root vboxsf     87 Aug 28 12:45 phpspec.yml
  -rwxrwx--- 1 root vboxsf    899 Aug 28 12:45 phpunit.xml
  drwxrwx--- 1 root vboxsf      0 Aug 28 12:45 public
  -rwxrwx--- 1 root vboxsf   1928 Aug 28 12:45 readme.md
  drwxrwx--- 1 root vboxsf      0 Aug 28 12:45 resources
  -rwxrwx--- 1 root vboxsf    567 Aug 28 12:45 server.php
  drwxrwx--- 1 root vboxsf      0 Aug 28 12:45 storage
  drwxrwx--- 1 root vboxsf      0 Aug 28 12:45 tests
  drwxrwx--- 1 root vboxsf   4096 Aug 28 12:56 vendor
  </code></pre>
  
  <hr>
  
  <p>This is my first time with nginx and cannot get laravel welcome page to show. I am using ubuntu 14.04 and VBox 5.</p>
  
  <p>I have my server configured in <code>/var/nginx/sites-enabled/default</code> as</p>
  
  <pre><code>server {
      listen 80 default_server;
      charset utf-8;
      server_name doimain.app www.domain.app;
  
      root /var/www/public;
      index index.php index.html;
  
      location / {
          try_files $uri $uri/ /index.php?$query_string;
      }
  
      location ~ \.php$ {
          try_files $uri /index.php =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
      }
  }
  </code></pre>
  
  <p>Inside <code>/var/www/public</code> I can list the laravel public folder files </p>
  
  <pre><code>$ ls -l /var/www/public
  total 3
  -rwxrwx--- 1 root vboxsf    0 Aug 28 12:45 favicon.ico
  -rwxrwx--- 1 root vboxsf 1786 Aug 28 12:45 index.php
  -rwxrwx--- 1 root vboxsf   24 Aug 28 12:45 robots.txt
  </code></pre>
  
  <p>But I get 404 when I go to <code>domain.app</code>. The nginx error log shows:</p>
  
  <pre><code>2015/08/28 14:29:35 [crit] 1487#0: *14 stat() "/var/www/public/index.php" failed (13: Permission denied), client: 10.0.0.18, server: domain.app, request: "GET / HTTP/1.1", host: "domain.app"
  </code></pre>
  
  <p>I have tried without success the following:</p>
  
  <p>Ensure www-data owns the folder structure <code>/var/www</code></p>
  
  <pre><code>$ sudo chown www-data:www-data /var/www
  </code></pre>
  
  <p>Changed access rights to <code>/var/www</code></p>
  
  <pre><code>$ sudo chmod -R 0755 /var/www
  </code></pre>
  
  <p>Thanks!</p>