2 Commits

Author SHA1 Message Date
172b4269d1 hosts/library: drop chat.ai.vimium.com proxying
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m19s
2025-11-01 14:53:03 +00:00
fbd308509d hosts/vps1: use mesh domains for upstreams 2025-11-01 14:52:48 +00:00
3 changed files with 33 additions and 41 deletions

View File

@@ -16,6 +16,7 @@ in
enable = true; enable = true;
package = pkgs.unstable.open-webui; package = pkgs.unstable.open-webui;
port = 8081; port = 8081;
host = "0.0.0.0";
environment = environment =
let let
clientId = "open-webui"; clientId = "open-webui";

View File

@@ -33,25 +33,6 @@
''; '';
}; };
}; };
"chat.ai.vimium.com" = {
listen = [
{
addr = "127.0.0.1";
port = 8001;
}
];
locations."/" = {
proxyPass = "http://localhost:8081";
extraConfig = proxyConfig + ''
# Disable proxy buffering for better streaming response from models
proxy_buffering off;
# Increase max request size for large attachments and long audio messages
client_max_body_size 20M;
proxy_read_timeout 10m;
'';
};
};
"jellyfin.vimium.com" = { "jellyfin.vimium.com" = {
default = true; default = true;
listen = [ listen = [

View File

@@ -82,14 +82,32 @@ in
maxSize = "100m"; maxSize = "100m";
}; };
}; };
resolver.addresses = [ "100.100.100.100" ];
upstreams = {
jellyfin.servers = {
"library.mesh.vimium.net:8096" = {
fail_timeout = "30s";
};
};
open-webui.servers = {
"library.mesh.vimium.net:8081" = {
fail_timeout = "30s";
};
};
skycam.servers = {
"skycam.mesh.vimium.net:1984" = {
fail_timeout = "30s";
};
};
};
virtualHosts = { virtualHosts = {
## Static sites ## Proxied sites
"chat.ai.vimium.com" = { "chat.ai.vimium.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
extraConfig = nginxErrorPages + nginxEdgeHeaders; extraConfig = nginxErrorPages + nginxEdgeHeaders;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8001"; proxyPass = "http://open-webui";
extraConfig = '' extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
@@ -112,24 +130,19 @@ in
"jellyfin.vimium.com" = { "jellyfin.vimium.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
extraConfig = nginxErrorPages + nginxEdgeHeaders; extraConfig = nginxEdgeHeaders + ''
locations."/" = { error_page 503 /maintenance.html;
proxyPass = "http://localhost:8000";
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
''; '';
locations."/maintenance.html" = {
root = "/var/www/html";
extraConfig = "internal; default_type text/html;";
};
locations."/" = {
return = "503";
}; };
}; };
## Static sites
"jdholt.com" = { "jdholt.com" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
@@ -140,11 +153,7 @@ in
}; };
locations."/skycam/snapshot.jpg" = { locations."/skycam/snapshot.jpg" = {
extraConfig = '' extraConfig = ''
set $backend "skycam.mesh.vimium.net:1984"; proxy_pass http://skycam/api/frame.jpeg?src=rpicam;
resolver 100.100.100.100;
proxy_pass http://$backend/api/frame.jpeg?src=rpicam;
proxy_cache skycam_cache; proxy_cache skycam_cache;
proxy_cache_valid any 10s; proxy_cache_valid any 10s;
proxy_ignore_headers Cache-Control Expires Set-Cookie; proxy_ignore_headers Cache-Control Expires Set-Cookie;
@@ -181,6 +190,7 @@ in
}; };
}; };
} }
## Redirects ## Redirects
// (mkRedirect "h0lt.com" "jdholt.com") // (mkRedirect "h0lt.com" "jdholt.com")
// (mkRedirect "jordanholt.xyz" "jdholt.com") // (mkRedirect "jordanholt.xyz" "jdholt.com")