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"



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.

Site Moderator
Site Moderator badge
July 1, 2024


Check your Nginx log and your Ghost app’s error log, the exact error should be present there.

It’s possible you did a typo of some sorts.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel