Phusion Passenger + php5-fpm + Rails + Drupal unable to deliver Drupal app

July 29, 2014 1.2k views

I've asked this on Stack Overflow already but have not received any response.

I'm having trouble getting Phusion Passenger to serve a Rails app as well as a Drupal app, which live on the same droplet.

The Rails app lives in ~/Kiji and the Drupal app lives in ~/asia-gazette, as shown in the config below.

When I try running curl kiji.dev I get the Rails app, which is correct. When I try running curl eag.dev (the Drupal app) from the server I am getting a 200 response with nothing else. No output, nothing in the nginx error.log file.

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)

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)$ {
        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;

My hosts file: kiji.dev  eag.dev

In my /etc/php5/fpm/pool.d/www.conf file, I have the following:

listen.owner = www-data
listen.group = www-data
;listen.mode = 0660

I've tried un-commenting the listen.mode and re-commenting but the result is the same. I restart nginx and php5-fpm and:

$ 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)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: eag.dev
> Accept: */*
< HTTP/1.1 200 OK
* Server nginx/1.6.0 is not blacklisted
< Server: nginx/1.6.0
< Date: Mon, 28 Jul 2014 15:57:06 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.5.9-1ubuntu4.3
* Connection #0 to host eag.dev left intact

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. Do you suggest I get rid of Passenger and just go with plain nginx? I really have no idea what else I can check to get this to work.


1 Answer

X-Powered-By: PHP/5.5.9-1ubuntu4.3

It looks like your virtualhost is properly configured -- the request is passed to PHP. It seems like there's a PHP error which is why you're getting a blank page. Try enabling PHP error logging: Show all errors while developing.

Have another answer? Share your knowledge.