title: Phusion Passenger + (Rails + Drupal) = unable to deliver Drupal app
body: <p>I'm having trouble getting Phusion Passenger to serve a Rails app as well as a Drupal app, which live on the same server.</p>
  
  <p>The Rails app lives in ~/Kiji and the Drupal app lives in ~/asia-gazette, as shown in the config below.</p>
  
  <p>When I try running <code>curl kiji.dev</code> I get the Rails app, which is correct. When I try running <code>curl eag.dev</code> (the Drupal app) from the server I am getting a 200 response with nothing else. No output, nothing in the nginx error.log file.</p>
  
  <p>Below is what my nginx.conf file looks like at the moment (note that I set the user for nginx as www-data so that it can be used by php5-fpm)</p>
  
  <pre><code>user  www-data;
  worker_processes  1;
  
  error_log  logs/error.log;
  events {
      worker_connections  1024;
  }
  
  http {
      passenger_root /home/dani/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48;
      passenger_ruby /home/dani/.rvm/gems/ruby-2.1.2/wrappers/ruby;
  
      include       mime.types;
      default_type  application/octet-stream;
  
      sendfile        on;
  
      keepalive_timeout  65;
  
      server {
          listen              80;
          server_name         kiji.dev;
      passenger_enabled   on;
      root   /home/dani/Kiji/public;
         location ~ ^/(assets)/ {
         expires max;
         add_header Cache-Control public;
         gzip_static on;
      }
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
      root   html;
    }
   }
  
      server {
        listen 80;
  
        root /home/dani/asia-gazette;
        server_name   eag.dev;
  
        location = /favicon.ico {
          log_not_found off;
          access_log off;
        }
  
        location = /robots.txt {
          allow all;
          log_not_found off;
          access_log off;
        }
  
        # This is needed for Drush
        location = /backup {
          deny all;
        }
  
        # Very rarely should these ever be accessed outside of the LAN
        location ~* \.(txt|log)$ {
          allow 127.0.0.1;
          deny all;
        }
  
        location / {
          try_files $uri $uri/ =404;
          index index.php;
        }
  
        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
          root /home/dani/asia-gazette;
        }
        location ~ \.php$ {
          try_files $uri =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          fastcgi_index index.php;
          include fastcgi_params;
        }
      }
    }
  </code></pre>
  
  <p>And my hosts file:</p>
  
  <pre><code>127.0.0.1 kiji.dev  eag.dev
  </code></pre>
  
  <p>In my /etc/php5/fpm/pool.d/www.conf file, I have the following:</p>
  
  <pre><code>listen.owner = www-data
  listen.group = www-data
  ;listen.mode = 0660
  </code></pre>
  
  <p>I've tried un-commenting the listen.mode and re-commenting but the result is the same. I restart nginx and php5-fpm and:</p>
  
  <pre><code>$ curl -v eag.dev
  * Rebuilt URL to: eag.dev/
  * Hostname was NOT found in DNS cache
  *   Trying xxx.xxx.xxx.xxx...
  * Connected to eag.dev (xxx.xxx.xxx.xxx) port 80 (#0)
  &gt; GET / HTTP/1.1
  &gt; User-Agent: curl/7.35.0
  &gt; Host: eag.dev
  &gt; Accept: */*
  &gt;
  &lt; HTTP/1.1 200 OK
  * Server nginx/1.6.0 is not blacklisted
  &lt; Server: nginx/1.6.0
  &lt; Date: Mon, 28 Jul 2014 15:57:06 GMT
  &lt; Content-Type: text/html
  &lt; Transfer-Encoding: chunked
  &lt; Connection: keep-alive
  &lt; X-Powered-By: PHP/5.5.9-1ubuntu4.3
  &lt;
  * Connection #0 to host eag.dev left intact
  </code></pre>
  
  <p>I'm really not sure what I'm doing wrong and why Passenger will not show my Drupal app.
  Any help would be much appreciated.</p>
  
  <p>Thank you!</p>