ActivityPub: 503 and then 404 and 401 errors, with Ghost CLI

I just ran ‘ghost update’ with the cli and am now on v6! Whoo hoo! However, once I clicked past the onboarding screens in Network, I’m getting the “Loading interrupted” error.

I saw mention in the changelog that self hosters could use activitypub, but I must be missing a step somewhere?

2 Likes

Hmm… hang on. I think my proxy is interfering.

[2025-08-04 11:24:01] ERROR Could not get webhook secret for ActivityPub FetchError: invalid json response body at https://www.spectralwebservices.com/.ghost/activitypub/v1/site/ reason: Unexpected token ‘<’, "<!DOCTYPE "… is not valid JSON

Turned my Cloudflare proxy off. I can see those requests getting to Ghost (they’re in the logs), but then they get 404’d. Requests look like:
GET /.ghost/activitypub/v1/feed/reader/ 404

(And half a dozen others that start with .ghost.)

1 Like

If you just want to use Ghost Pro hosted AP server, you need to proxy those requests to Ghost Pro ActivityPub server. Your Nginx or Caddy proxy should have a rule for it. Like this: ghost-docker/caddy/snippets/ActivityPub at main · TryGhost/ghost-docker · GitHub

If you are running your own AP server, then you need to proxy those requests to your AP server.

1 Like

I was just looking at those, Murat! Going to try that next :slight_smile:

1 Like

Hmm. Still getting 503 errors. Bah.I added:

location ^~ /.ghost/activitypub/ {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass https://ap.ghost.org;
}

# Proxy well-known endpoints
location = /.well-known/webfinger {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass https://ap.ghost.org;
}

location = /.well-known/nodeinfo {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass https://ap.ghost.org;
}

# Default Ghost proxy
location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:2368;

    add_header X-Content-Type-Options $header_content_type_options;
}

Yeah, so far I’ve just traded 404 errors for 503 errors. laughing

Right, well, I’m on 6.0 without the new features. Back to paying work.

Self-hosting. Still not for wimps.

1 Like

I haven’t tried it myself, but it’s possible that ap.ghost.org is not ready yet. I (well, a customer) have experienced the same with the new Explore API/writing a testimonial through Ghost. That also just returned a 404.

503 could also make sense for that, in case ap.ghost.org has a proxy, but no service behind it.

Just guessing here, but it’s entirely possible the issue is not on your end :smiley:

I think at this point I’m proxying correctly. @acburdine was kind enough to point me at the PR showing how my nginx config needed to change, here: Added activitypub path to nginx by rmgpinto · Pull Request #1963 · TryGhost/Ghost-CLI · GitHub
(My previous attempt was not quite the same, and apparently wrong.)

I’m now getting 401, and the server is saying “No account found” on all activity-pub related requests. So… pretty sure I’ve got the proxy bit right, but something else wrong. Somewhere.

:joy:

3 Likes

8 posts were split to a new topic: ActivityPub: 429 errors and partial UI loading

4 posts were split to a new topic: ActivityPub: Questions about Docker architecture requirements

A post was merged into an existing topic: ActivityPub: 429 errors and partial UI loading

Apologies, in my clean up process, I lost a bit that belonged here, from @DIYBrad , because it was the jumping off point for a different discussion. Here’s what @DIYBrad wrote:

I’ve attempted to proxy to Ghost as well using nginx example but also get 503/401 errors.

To follow up on my original problem on my Ghost-CLI install using Ghost’s hosted ActivityPub, the missing piece for me after sorting out the nginx bits above was that I have my admin dashboard on a separate subdomain from the main site, which means that I needed to add a redirect from not-admin-site.tld/ghost/* over to actual-admin-site.tld/ghost/

If this redirect doesn’t occur (or is blocked in some way), Ghost’s ActivityPub instance can’t get configuration information from your Ghost install that it needs to allow you to use it.

The clearest symptom for this problem is a message when Ghost first starts up webhook secrets:
ERROR Could not get webhook secret for ActivityPub FetchError: invalid json response body at …

I added a redirect with Cloudflare since I already had some rewrite rules in place.

A member of the Ghost Foundation dev team has a PR open that fixes this behavior, so hopefully when 6.0.1 comes out, that’ll get the problem resolved (by Ghost handling the redirect) without needing the extra redirect.

If you are having problems with ActivityPub that are very similar to this problem, please feel free to post them here. If your problem doesn’t look a whole lot like this (401 errors in the console and “Could not get webhook secret), using Ghost-hosted ActivityPub and a Ghost-CLI install, please pick a different thread or start a new one, thanks.

2 Likes

4 posts were split to a new topic: ActivityPub: Self-hosting ActivityPub and routing with nginx

Yep me too

[2025-08-09 14:25:54] ERROR Could not get webhook secret for ActivityPub FetchError: invalid json response body at https://jilles.me/.ghost/activitypub/v1/site reason: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
[2025-08-09 14:25:54] ERROR No webhook secret found - cannot initialise

I peeked at your site and got an nginx error, so you must be working on things right now. :slight_smile: What fixed my problem was getting the redirect working and then restarting Ghost, so I’m hoping the same will be true for you! :slight_smile:

I updated nginx but now just getting


[2025-08-09 14:53:44] ERROR No webhook secret found - cannot initialiseS

So I can’t even start Ghost

I think you’ve got a separate problem in your nginx config. That error didn’t stop Ghost from starting up for me. What does ghost ls show? Is it running, but nginx can’t connect, perhaps?

After updating Ghost, I noticed the new Networking tab in Ghost Admin. When I open it the first time it loads, but if I click Network again I only see “Loading Interrupted.” Any ideas if this is still WIP or if I’ve misconfigured something?

Setup

  • Hosting: Self-hosted

  • Proxy: Nginx

  • Changes made: None to Nginx yet (hesitant to tweak if that’s not the issue)

What I’ve tried

  • Hard reload / clear cache

  • Incognito window & a second browser

  • Confirmed site & Admin are on the same origin/URL

Questions

  • Is the Networking tab expected to be stable right now, or still in progress?

  • If it should work, what should I check in my Nginx or Ghost config?

Happy to share logs/configs—what’s most useful?

Tell me what to grab and I’ll post it. Here’s what I can provide immediately:
Ghost-CLI version: 1.28.3
Ghost version: 6.0.1

:check_mark: Checking system Node.js version - found v22.18.0
:check_mark: Checking logged in user
:check_mark: Ensuring user is not logged in as ghost user
:check_mark: Checking if logged in user is directory owner
:check_mark: Checking current folder permissions
:check_mark: Checking system compatibility
:check_mark: Checking for a MySQL installation

  • sudo systemctl is-active
    Instance is currently running
    :information_source: Validating config [skipped]
    :check_mark: Checking folder permissions
    :check_mark: Checking file permissions
    :check_mark: Checking content folder ownership
    :check_mark: Checking memory availability
    :check_mark: Checking binary dependencies
    :check_mark: Checking free space
    :check_mark: Checking systemd unit file
    :check_mark: Checking systemd node version - found v22.18.0

ActivityPub: 503 and then 404 and 401 errors, with Ghost CLI - #5 by Cathy_Sarisky

You absolutely need nginx changes. It doesn’t work without them. :slight_smile:

There’s a link up thread, but here it is again: Added activitypub path to nginx by rmgpinto · Pull Request #1963 · TryGhost/Ghost-CLI · GitHub

1 Like