refactor(minecraft): Use local tiles when server is offline
This commit is contained in:
parent
cbef8398ab
commit
9720ff348c
1 changed files with 29 additions and 7 deletions
|
@ -116,12 +116,34 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nginx.virtualHosts."minecraft.rcia.dev" = {
|
nginx.virtualHosts."minecraft.rcia.dev" = {
|
||||||
locations."/".return = "307 https://minecraft.rcia.dev/fabric_prod/";
|
extraConfig = "gzip_static always;";
|
||||||
locations."/fabric_prod".return =
|
locations = {
|
||||||
"308 https://minecraft.rcia.dev/fabric_prod/";
|
"/".return = "307 scheme://$host/fabric_prod/";
|
||||||
locations."~/fabric_prod/(.*)$".proxyPass = "http://127.0.0.1:${
|
"/fabric_prod".return = "308 $scheme://$host/fabric_prod/";
|
||||||
toString ports.tcp.minecraft-fabric-prod-bluemap
|
"/fabric_prod/" = {
|
||||||
}/$1";
|
alias =
|
||||||
|
"${config.services.minecraft-servers.dataDir}/fabric_prod/bluemap/web/";
|
||||||
|
extraConfig = "error_page 404 = @no-content;";
|
||||||
|
};
|
||||||
|
"~* ^/fabric_prod/(maps/[^/\\s]*/live/.*)" = {
|
||||||
|
proxyPass = "http://127.0.0.1:${
|
||||||
|
toString ports.tcp.minecraft-fabric-prod-bluemap
|
||||||
|
}/$1";
|
||||||
|
extraConfig = ''
|
||||||
|
error_page 502 504 = @server-offline;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"@no-content" = {
|
||||||
|
return = "204";
|
||||||
|
extraConfig = "internal;";
|
||||||
|
};
|
||||||
|
"@server-offline" = {
|
||||||
|
root =
|
||||||
|
"${config.services.minecraft-servers.dataDir}/fabric_prod/bluemap/web";
|
||||||
|
tryFiles = "$uri =410";
|
||||||
|
extraConfig = "internal;";
|
||||||
|
};
|
||||||
|
};
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "rcia.dev";
|
useACMEHost = "rcia.dev";
|
||||||
};
|
};
|
||||||
|
@ -135,5 +157,5 @@ in {
|
||||||
owner = "minecraft";
|
owner = "minecraft";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
users.groups.minecraft.members = [ "avery" ];
|
users.groups.minecraft.members = [ "avery" "nginx" ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue