Mastodon nginx: use `@soapbox` named location for consistency

merge-requests/1355/head
Alex Gleason 2022-05-11 18:22:07 -05:00
rodzic dd91f24da7
commit d49e8c61a1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -14,7 +14,7 @@ map $http_upgrade $connection_upgrade {
# ActivityPub routing.
map $http_accept $activitypub_location {
default /index.html;
default @soapbox;
"application/activity+json" @proxy;
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' @proxy;
}
@ -71,7 +71,7 @@ server {
add_header Strict-Transport-Security "max-age=31536000" always;
# Fallback route.
# Everything not routed should fall back to the SPA.
# Try static files, then fall back to the SPA.
location / {
try_files /dev/null @static-files;
}
@ -85,7 +85,7 @@ server {
# Mastodon ActivityPub routes.
# Conditionally send to Mastodon by Accept header.
location ~ ^/(inbox|users|@(.+)) {
try_files $activitypub_location $activitypub_location;
try_files /dev/null $activitypub_location;
}
# Soapbox & Mastodon (frontend) build files.
@ -108,11 +108,16 @@ server {
add_header Strict-Transport-Security "max-age=31536000" always;
}
# Mastodon public files.
# Soapbox SPA (Single Page App).
location @soapbox {
try_files /index.html /dev/null;
}
# Mastodon public files (fallback to Soapbox SPA).
# https://github.com/mastodon/mastodon/tree/main/public
location @mastodon-public {
root /home/mastodon/live/public;
try_files $uri /index.html;
try_files $uri @soapbox;
}
# Soapbox & Mastodon static files.