From 25cb4f70ece4f41bb41b97587f8f9f2c0bc3f045 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sun, 6 Aug 2023 16:49:31 -0700 Subject: [PATCH] Add jichan.org API routes, minor tweaks --- hosts/elnudrop/hosts/jichan.org/default.nix | 24 +++++++++++++++---- .../hosts/tegakituesday.com/default.nix | 6 ++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/hosts/elnudrop/hosts/jichan.org/default.nix b/hosts/elnudrop/hosts/jichan.org/default.nix index 627b50e..9c16b7a 100644 --- a/hosts/elnudrop/hosts/jichan.org/default.nix +++ b/hosts/elnudrop/hosts/jichan.org/default.nix @@ -1,3 +1,4 @@ +with import ../../../../modules/tailscale/default.nix; let host = "jichan.org"; in { services.nginx.virtualHosts."www.${host}" = { forceSSL = true; @@ -11,13 +12,28 @@ let host = "jichan.org"; in { error_page 502 /502.html; ''; locations = { - "/" = { - proxyPass = with import ../../../../modules/tailscale/default.nix; "http://${elnuhub}:3334"; - proxyWebsockets = true; - }; + "/".proxyPass = "http://${elnuhub}:3334"; "/502.html".root = "${./502}"; "/logo.svg".root = "${./502}"; "/missing.min.css".root = "${../shared/502}"; + + # Formerly tatoeba.elnu.com + # https://git.elnu.com/ElnuDev/tatoeba-api + "/api/tatoeba/" = { + proxyPass = "http://${elnuhub}:3001"; + extraConfig = '' + rewrite ^/api/tatoeba/(.*) /$1 break; + ''; + }; + + # Formerly images.elnu.com + # https://git.elnu.com/ElnuDev/image-api + "/api/images/" = { + proxyPass = "http://${elnuhub}:3002"; + extraConfig = '' + rewrite ^/api/images/(.*) /$1 break; + ''; + }; }; }; } \ No newline at end of file diff --git a/hosts/elnudrop/hosts/tegakituesday.com/default.nix b/hosts/elnudrop/hosts/tegakituesday.com/default.nix index 64ae077..91e5c7a 100644 --- a/hosts/elnudrop/hosts/tegakituesday.com/default.nix +++ b/hosts/elnudrop/hosts/tegakituesday.com/default.nix @@ -1,3 +1,4 @@ +with import ../../../../modules/tailscale/default.nix; let host = "tegakituesday.com"; in { services.nginx.virtualHosts."www.${host}" = { forceSSL = true; @@ -11,10 +12,7 @@ let host = "tegakituesday.com"; in { error_page 502 /502.html; ''; locations = { - "/" = { - proxyPass = with import ../../../../modules/tailscale/default.nix; "http://${elnuhub}:3335"; - proxyWebsockets = true; - }; + "/".proxyPass = "http://${elnuhub}:3335"; "/502.html".root = "${./502}"; "/mascot.png".root = "${./502}"; "/missing.min.css".root = "${../shared/502}";