MyNixOS website logo
option

services.mastodon.configureNginx

Configure nginx as a reverse proxy for mastodon. Note that this makes some assumptions on your setup, and sets settings that will affect other virtualHosts running on your nginx instance, if any. Alternatively you can configure a reverse-proxy of your choice to serve these paths:

/ -> $(nix-instantiate --eval '<nixpkgs>' -A mastodon.outPath)/public

/ -> 127.0.0.1:{{ webPort }} (If there was no file in the directory above.)

/system/ -> /var/lib/mastodon/public-system/

/api/v1/streaming/ -> 127.0.0.1:{{ streamingPort }}

Make sure that websockets are forwarded properly. You might want to set up caching of some requests. Take a look at mastodon's provided nginx configuration at https://github.com/mastodon/mastodon/blob/master/dist/nginx.conf.

Declarations
Type
boolean
Default
false