Mastodon nginx: ActivityPub routing

homepage-hide-logo
Alex Gleason 2 years ago
parent 1d3a928293
commit 8ba2db78d7
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -8,6 +8,14 @@ map $http_upgrade $connection_upgrade {
'' close; '' close;
} }
# ActivityPub routing.
map $http_accept $activitypub_location {
default /index.html;
"application/activity+json" @proxy;
# Increase `map_hash_bucket_size` to enable this route:
# 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' @proxy;
}
upstream backend { upstream backend {
server 127.0.0.1:3000 fail_timeout=0; server 127.0.0.1:3000 fail_timeout=0;
} }
@ -71,13 +79,11 @@ server {
try_files /dev/null @proxy; try_files /dev/null @proxy;
} }
# # Mastodon ActivityPub routes. # Mastodon ActivityPub routes.
# # Conditionally send to Mastodon by Accept header. # Conditionally send to Mastodon by Accept header.
# if ($http_accept = "application/activity+json" || $http_accept = "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") { location ~ ^/(inbox|outbox|users|@(.+)) {
# location ~ ^/(inbox|outbox|users|@) { try_files $activitypub_location $activitypub_location;
# try_files /dev/null @proxy; }
# }
# }
# Mastodon public files. # Mastodon public files.
# https://github.com/mastodon/mastodon/tree/main/public # https://github.com/mastodon/mastodon/tree/main/public

Loading…
Cancel
Save