Mastodon nginx: ActivityPub routing
This commit is contained in:
parent
1d3a928293
commit
8ba2db78d7
1 changed files with 13 additions and 7 deletions
|
@ -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…
Reference in a new issue