Added SMTP settings to my config.production.json file for the Ghost install on my droplet and now I am seeing 502 Bad Gateway?

Following the guidance of the config docs provided online by Ghost, and having established a Mailgun account, I opened config.production.json using nano via the console provided by DigitalOcean, added the necessary settings to establish SMTP, saved the update by hitting ^X and then enter.

I ran GHOST RESTART, and all seemed well, but when I go to the URL, now there is a 502. Any advice is welcome.

The updated JSON is below with the password removed. Thank you.


  "url": "",

  "server": {

    "port": 2369,

    "host": ""


  "database": {

    "client": "mysql",

    "connection": {

      "host": "",

      "user": "ghost-991",

      "password": ".2I[UTS9dIw[Du82NmeP",

      "port": 3306,

      "database": "ghost_production"



  "mail": {

    "transport": "SMTP"

    "options": {

      "service": "Mailgun",

      "auth": {

        "user": "",

        "pass": "[removed for posting]"




  "logging": {

    "transports": [





  "process": "systemd",

  "paths": {

    "contentPath": "/var/www/ghost/content"



The linked URL is working, so I guess you sorted it, or the server was still coming online.

I ended up destroying the droplet and rebuilding, but every time I try to edit the Mail settings in the config.production.json, ghost doctor says the config is invalid.