Webservers

Since ActivityPub relies on JSON content types for retrieving activities, most instances will support content negotiation, where according to the client’s request headers, will return either the HTML or the JSON-LD representation of an activity.

With static ActivityPub, we don’t have content negotiation, each URL contains its file extension, so the webserver needs to add the correct Content-Type header to the response.

This is why JSON-LD files generated by this plugin use the .jsonld extension, so they’re separate from regular JSON files.

Unfortunately, some well-known URLs can’t include the extension, so they need to be configured separately.

See the Site configuration to point clients requesting the HTML URL to their JSON counterparts.

Nginx

Add the MIME type, typically at /etc/nginx/mime.types:

types {
  application/activity+json jsonld;
}

Then, on your server block:

server {
  location /.well-known/host-meta {
    default_type "application/xrd+xml";
  }

  location /.well-known/webfinger {
    default_type "application/jrd+json";
  }

  location /.well-known/nodeinfo {
    default_type "application/jrd+json";
  }
}