Migrate Mastodon to NixOS
This commit is contained in:
parent
7055927848
commit
c347478e96
11 changed files with 256 additions and 78 deletions
48
config/hosts/mastodon/nginx.nix
Normal file
48
config/hosts/mastodon/nginx.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
group = "mastodon";
|
||||
virtualHosts."social.nekover.se" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 80;
|
||||
}
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 8443;
|
||||
ssl = true;
|
||||
extraParameters = [ "proxy_protocol" ];
|
||||
}
|
||||
];
|
||||
|
||||
root = "${config.services.mastodon.package}/public/";
|
||||
|
||||
locations = {
|
||||
"/" = {
|
||||
tryFiles = "$uri @proxy";
|
||||
};
|
||||
|
||||
"/system/".alias = "/var/lib/mastodon/public-system/";
|
||||
|
||||
"^~ /api/v1/streaming" = {
|
||||
proxyPass = "http://unix:/run/mastodon-streaming/streaming.socket";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
|
||||
"@proxy" = {
|
||||
proxyPass = "http://unix:/run/mastodon-web/web.socket";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
set_real_ip_from 10.202.41.100;
|
||||
real_ip_header proxy_protocol;
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue