nix-config/hosts/elnudrop/hosts/jichan.org/default.nix

39 lines
No EOL
1 KiB
Nix

with import ../../../../modules/tailscale/default.nix;
let host = "jichan.org"; in {
services.nginx.virtualHosts."www.${host}" = {
forceSSL = true;
enableACME = true;
globalRedirect = host;
};
services.nginx.virtualHosts."${host}" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
error_page 502 /502.html;
'';
locations = {
"/".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;
'';
};
};
};
}