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

  • Posted on July 29, 2014
  • danielepAsked by danielep

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 I get the Rails app, which is correct. When I try running curl (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;
    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;

      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:

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

listen.owner = www-data = 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
* Rebuilt URL to:
* Hostname was NOT found in DNS cache
*   Trying
* Connected to ( port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host:
> 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 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.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.