Mastodon nginx: ActivityPub routing

merge-requests/1345/head
Alex Gleason 2022-05-10 15:40:25 -05:00
rodzic 1d3a928293
commit 8ba2db78d7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 13 dodań i 7 usunięć

Wyświetl plik

@ -8,6 +8,14 @@ map $http_upgrade $connection_upgrade {
'' 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 {
server 127.0.0.1:3000 fail_timeout=0;
}
@ -71,13 +79,11 @@ server {
try_files /dev/null @proxy;
}
# # Mastodon ActivityPub routes.
# # 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|@) {
# try_files /dev/null @proxy;
# }
# }
# Mastodon ActivityPub routes.
# Conditionally send to Mastodon by Accept header.
location ~ ^/(inbox|outbox|users|@(.+)) {
try_files $activitypub_location $activitypub_location;
}
# Mastodon public files.
# https://github.com/mastodon/mastodon/tree/main/public