elnudrop: host images API, refactoring
This commit is contained in:
parent
c393cbb98f
commit
65ae45eaaf
5 changed files with 36 additions and 30 deletions
|
@ -39,6 +39,4 @@
|
|||
};
|
||||
|
||||
services.do-agent.enable = true;
|
||||
|
||||
services.tatoeba.enable = true;
|
||||
}
|
|
@ -1,6 +1,10 @@
|
|||
{ enableSSL, ... }:
|
||||
|
||||
let host = "jichan.org"; in {
|
||||
imports = [
|
||||
./tatoeba.nix
|
||||
./images.nix
|
||||
];
|
||||
services.nginx.virtualHosts."www.${host}" = {
|
||||
forceSSL = enableSSL;
|
||||
enableACME = enableSSL;
|
||||
|
@ -17,24 +21,6 @@ let host = "jichan.org"; in {
|
|||
"/502.html".root = "${./502}";
|
||||
"/logo.svg".root = "${./502}";
|
||||
"/missing.min.css".root = "${../shared/502}";
|
||||
|
||||
# Formerly tatoeba.elnu.com
|
||||
# https://git.elnu.com/jichan.org/apis
|
||||
"/api/tatoeba/" = {
|
||||
proxyPass = "http://localhost:3001";
|
||||
extraConfig = ''
|
||||
rewrite ^/api/tatoeba/(.*) /$1 break;
|
||||
'';
|
||||
};
|
||||
|
||||
# Formerly images.elnu.com
|
||||
# https://git.elnu.com/jichan.org/apis
|
||||
"/api/images/" = {
|
||||
proxyPass = "http://localhost:3002";
|
||||
extraConfig = ''
|
||||
rewrite ^/api/images/(.*) /$1 break;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
11
hosts/elnudrop/hosts/jichan.org/images.nix
Normal file
11
hosts/elnudrop/hosts/jichan.org/images.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.images.enable = true;
|
||||
services.nginx.virtualHosts."jichan.org".locations."/api/images" = {
|
||||
proxyPass = "http://localhost:${builtins.toString config.services.images.port}";
|
||||
extraConfig = ''
|
||||
rewrite ^/api/images/(.*) /$1 break;
|
||||
'';
|
||||
};
|
||||
}
|
11
hosts/elnudrop/hosts/jichan.org/tatoeba.nix
Normal file
11
hosts/elnudrop/hosts/jichan.org/tatoeba.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.tatoeba.enable = true;
|
||||
services.nginx.virtualHosts."jichan.org".locations."/api/tatoeba" = {
|
||||
proxyPass = "http://localhost:${builtins.toString config.services.tatoeba.port}";
|
||||
extraConfig = ''
|
||||
rewrite ^/api/tatoeba/(.*) /$1 break;
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue