Question

Multiple Ghost Blogs on one Droplet

I’m trying to set up three different ghost blogs on one droplet. I have followed the instructions in the tutorial: https://www.digitalocean.com/community/tutorials/how-to-serve-multiple-ghost-blogs-on-one-vps-using-nginx-server-blocks but right now all my domain names are pointing to the same blog instance and I can’t seem to figure out where I have come wrong. I’ve attached the /etc/mginx/sites-enabled config files as well as the ghost/config files below. I’ve googled trying to find a solution but can’t seem to come up with anything.

domain 1 nginx config

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    server_name rachelmfisher.com; # Replace with your domain

    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 10G;

    location / {
        proxy_pass http://localhost:2368;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }
}

domain 2 nginx config

server {
    listen 80;
    listen [::]:80;

    server_name yougotalottanerve.com; # Replace with your domain

    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 10G;

    location / {
        proxy_pass http://localhost:2369;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }
}

domain 3 nginx config

server {
    listen 80;
    listen [::]:80;

    server_name doombunnyctr.com; # Replace with your domain

    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 10G;

    location / {
        proxy_pass http://localhost:2778;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }
}

domain1 ghost/config.js

// Prepared via DigitalOcean 1-Click provisioning
// # Ghost Configuration
// Setup your Ghost install for various [environments](http://support.ghost.org/config/#about-environments).

// Ghost runs in `development` mode by default. Full documentation can be found at http://support.ghost.org/config/

var path = require('path'),
    config;

config = {
    // ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: 'http://rachelmfisher.com',
        mail: {},
        database: {

            // This part was prepared during first boot by DigitalOcean's 1-Click first-provisioning
            // This section is unique to this droplet
            client: 'mysql',
                connection: {
                  host     : '127.0.0.1',
                  user     : 'ghost',
                  password : 'aec8989f6d573cb93a65c41dc0122ebe4118e1ae0104a534',
                  database : 'ghost',
                  charset  : 'utf8'
            // End of per-droplet configuration
            },
            debug: false
        },

        server: {
            host: '127.0.0.1',
            port: '2368'
        }
    },

domain2 ghost/config.js

// Prepared via DigitalOcean 1-Click provisioning
// # Ghost Configuration
// Setup your Ghost install for various [environments](http://support.ghost.org/config/#about-environments).

// Ghost runs in `development` mode by default. Full documentation can be found at http://support.ghost.org/config/

var path = require('path'),
    config;

config = {
    // ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: 'http://yougotalottanerve.com',
        mail: {},
        database: {

            // This part was prepared during first boot by DigitalOcean's 1-Click first-provisioning
            // This section is unique to this droplet
            client: 'mysql',
                connection: {
                  host     : '127.0.0.1',
                  user     : 'ghost',
                  password : 'aec8989f6d573cb93a65c41dc0122ebe4118e1ae0104a534',
                  database : 'ghost',
                  charset  : 'utf8'
            // End of per-droplet configuration
            },
            debug: false
        },

        server: {
            host: '127.0.0.1',
            port: '2369'
        }
    },

domain3 ghost/config.js

// Prepared via DigitalOcean 1-Click provisioning
// # Ghost Configuration
// Setup your Ghost install for various [environments](http://support.ghost.org/config/#about-environments).

// Ghost runs in `development` mode by default. Full documentation can be found at http://support.ghost.org/config/

var path = require('path'),
    config;

config = {
    // ### Production
    // When running Ghost in the wild, use the production environment.
    // Configure your URL and mail settings here
    production: {
        url: 'http://doombunnyctr.com',
        mail: {},
        database: {

            // This part was prepared during first boot by DigitalOcean's 1-Click first-provisioning
            // This section is unique to this droplet
            client: 'mysql',
                connection: {
                  host     : '127.0.0.1',
                  user     : 'ghost',
                  password : 'aec8989f6d573cb93a65c41dc0122ebe4118e1ae0104a534',
                  database : 'ghost',
                  charset  : 'utf8'
            // End of per-droplet configuration
            },
            debug: false
        },

        server: {
            host: '127.0.0.1',
            port: '2778'
        }
    },

Any assistance would be greatly appreciated!

Show comments

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.

@Elenaltarien

I was actually about to comment on that – glad you were able to get that resolved!

One thing I would comment on is what you’ve exposed in the Ghost Configuration (your MySQL user and password). If those are valid connection details for your database, please make sure you change at least the password as it’s now exposed and would allow anyone to potentially attempt to connect.

MySQL root password was stored at /root/.digitalocean_password for me, per info in MOTD message, which by the way didn’t display until after reboot and THEN the next SSH login.

is this still applicable today? 01-10-2018 we only have ‘config.production.json’ in the ghost folder with structure:

  "url": "http://159.XXX.XX.XXX",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "ghost",
      "password": "XXXXXXXXX",
      "database": "ghost_production"
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  }
}