Question

Ghost + Wordpress + Nginx on Ubuntu Droplet

Trying to install a Wordpress website and a ghost blog onto one ubuntu droplet using Nginx.

I’ve tried following:

I can’t to get it working. There was an article exactly about what I’m trying to do, but it no longer exists:

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/example.com/html/ 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.


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.

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: <pre> server {
listen 80;
server_name ghost-blog-domain.com ;

client_max_body_size 10M;
                                                                         
location / {                                                             
        proxy_pass http://localhost:2368/;                               
        proxy_set_header Host $host;                                     
        proxy_buffering off;                                             
}                                                                        

} </pre> The port used for the proxy_pass should match the “port” setting in <code>/var/www/ghost-blog-domain.com/ghost/config.js</code>

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 :)