Hi all. I’m having the darndest time trying to get newsletter bulk sending working. I’m running ghost in docker alongside MariaDB (since Maria uses the same engine as MySQL, this works seamlessly with ghost, as far as I can tell—that’s not my issue). Everything is running behind nginx as a reverse proxy, configured outside of docker, which is listening to port 443 and using proxy_pass to forward requests to http://localhost:5555.
The error I am getting is that when I try to publish a post and send a newsletter, it’s unable to reach Mailgun’s API.
At first, I thought it might be because it’s running in docker and can’t access the host network. But transactional emails over SMTP work fine—it’s only the HTTPS request that does not work.
I’ve tried all sorts of things. I’ve tried opening the docker container to the host network, but then I couldn’t connect to my database. I’ve tried explicitly mapping 443 in the ghost container, but that’s not working. I’ve opened port 443 on my web host for both ingress and egress. I’m at a loss here.
Why can’t ghost make an API call out to the internet from inside the docker container?
From what you’ve described, it seems like there might be an issue with the container’s network settings, especially if it’s able to send SMTP but not access Mailgun’s HTTPS API.
One thing to try is setting the network mode to host in your Docker Compose file for the Ghost container. It might look something like this:
network_mode: host