Mastodon nginx: use @soapbox
named location for consistency
This commit is contained in:
parent
dd91f24da7
commit
d49e8c61a1
1 changed files with 10 additions and 5 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue