diff --git a/installation/mastodon.conf b/installation/mastodon.conf index ec6df7532..eedc2d6fc 100644 --- a/installation/mastodon.conf +++ b/installation/mastodon.conf @@ -97,11 +97,12 @@ server { add_header Strict-Transport-Security "max-age=31536000" always; } - # Soapbox build files. + # Soapbox & Mastodon (frontend) build files. # New builds produce hashed filenames, so these should be cached heavily. location /packs { add_header Cache-Control "public, max-age=31536000, immutable"; add_header Strict-Transport-Security "max-age=31536000" always; + try_files $uri @mastodon-public; } # Soapbox configuration files. @@ -116,6 +117,13 @@ server { add_header Strict-Transport-Security "max-age=31536000" always; } + # Mastodon public files. + # https://github.com/mastodon/mastodon/tree/main/public + location @mastodon-public { + root /home/mastodon/live/public; + try_files $uri /index.html; + } + # Proxy to Mastodon's Ruby on Rails backend. location @proxy { proxy_set_header Host $host;