If you’re looking for help, please provide information about your environment. If you delete this template and don’t provide any information, your topic will be automatically closed.
If you aren’t running the latest version of Ghost, the first thing we’ll ask you to do is update to the latest version of Ghost.
- What’s your URL? https://theprospecttimes.com
- What version of Ghost are you using? 6.5.3
And
- How was Ghost installed and configured?
- Through a Dockerfile
- What Node version, database, OS & browser are you using?
- Node version 22, MySQL db, ghost docker image and microsoft edge
- What errors or information do you see in the console?
- POST https://theprospecttimes.com/.ghost/analytics/api/v1/page_hit?name=analytics_events net::ERR_ABORTED 502 (Bad Gateway)
- What steps could someone else take to reproduce the issue you’re having?
- Run the dockerfile alongside the container
Hello all,
I have a custom Ghost setup under a dockerfile with Caddy for activitypub, on flyio. I tried to set up tinybird by doing the following:
- Running docker compose on my machine and getting api, admin, relevant keys for tinybird
- Adding it to my ghost install
- Creating a new flyio app with traffic analytics image
- Using internal routing under caddy to route to the traffic analytics app
Whenever I open the site, I get a message saying 502 Bad Gateway under console. I believe it should be reachable by ghost, but not too sure since it is possible fly’s internal routing is ipv6 only, and the log shows its listening on ipv4 addresses
I would be happy to share any other information, like the fly config file. Environment variables wise, i kept it to be the same as the one found in docker compose. Thank you!
Log
2025-11-01T12:02:44.238 app[e28630d4ce4758] dfw [info] {"level":30,"timestamp":{"seconds":1761998564,"nanos":203000000},"pid":649,"hostname":"e28630d4ce4758","message":"Server listening at http://127.0.0.1:3000"}
2025-11-01T12:02:44.238 app[e28630d4ce4758] dfw [info] {"level":30,"timestamp":{"seconds":1761998564,"nanos":203000000},"pid":649,"hostname":"e28630d4ce4758","message":"Server listening at http://172.19.28.10:3000"}
2025-11-01T12:02:44.238 app[e28630d4ce4758] dfw [info] {"level":30,"timestamp":{"seconds":1761998564,"nanos":203000000},"pid":649,"hostname":"e28630d4ce4758","message":"Server listening at http://172.19.28.11:3000"}
Dockerfile
FROM caddy:2 AS caddy
FROM ghost:6
COPY --from=caddy /usr/bin/caddy /usr/bin/caddy
COPY ./Caddyfile /etc/caddy/Caddyfile
COPY ./snippets/ /etc/caddy/snippets/
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends supervisor; \
rm -rf /var/lib/apt/lists/*
COPY ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
EXPOSE 8080
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]
Caddyfile
# Proxy analytics requests with any prefix (e.g. /.ghost/analytics/ or /blog/.ghost/analytics/)
@analytics_paths path_regexp analytics_match ^(.*)/\.ghost/analytics(.*)$
handle @analytics_paths {
rewrite * {re.analytics_match.2}
reverse_proxy ghost-tb-1.internal:3000
}