Ghost + Wordpress + Nginx on Ubuntu Droplet

June 19, 2014 2.2k views
Trying to install a Wordpress website and a ghost blog onto one ubuntu droplet using Nginx. I've tried following: - How To Serve Multiple Ghost Blogs on One VPS Using Nginx Server Blocks ( - How To Configure Single and Multiple WordPress Site Settings with Nginx ( - How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 14.04 LTS ( - How To Set Up nginx Virtual Hosts (Server Blocks) on Ubuntu 12.04 LTS ( I can't to get it working. There was an article exactly about what I'm trying to do, but it no longer exists: - Wordpress & Ghost combo ( The Wordpress installation on Nginx is up and running. I've added my two domains to in my DNS settings and I've written separate sites-available (and sites-enabled) files for the two domains pointing to different /var/www/ directories. I've installed all the necessary dependancies and I tried to start up a fresh installation of Ghost. But, it opens up listing the contents of the index.js file rather than loading the site. Node.js is installed, I reinstalled npm etc etc. No luck.
2 Answers
I think that getting Wordpress set up first is a good strategy. It sounds like you're half way there. What does the Nginx configuration file for your Ghost blog set up look like? Running Ghost is different than a PHP based site like Wordpress. Node.js is actually running the site locally on some port (2368 by default), and Nginx then proxies that to port 80. The config file should look something like:
server {                                                                         
    listen 80;                                                             
    server_name ;                                      

    client_max_body_size 10M;
    location / {                                                             
            proxy_pass http://localhost:2368/;                               
            proxy_set_header Host $host;                                     
            proxy_buffering off;                                             
The port used for the proxy_pass should match the "port" setting in /var/www/ Let us know how it goes!

Perfect! My Ghost site's Nginx config (sites-available file) was essentially a duplicate of the Wordpress site's with the only changes being the domain name and the directory the site was stored in.

Your config file suggestion works perfectly! Thank you for your help :)

Have another answer? Share your knowledge.