This commit is contained in:
Bryan Ramos 2026-04-14 00:55:20 -04:00
parent 573f5ec95d
commit d8be05169c
2 changed files with 11 additions and 0 deletions

View file

@ -163,6 +163,7 @@ in
proxyPass = "http://192.168.0.23:8002/";
proxyWebsockets = true;
extraConfig = ''
include ${config.sops.templates."nginx-mcp-auth.conf".path};
proxy_read_timeout 300s;
proxy_send_timeout 300s;
'';

View file

@ -26,6 +26,16 @@
owner = "nginx";
};
# MCP endpoint auth — validates X-API-Key header
sops.templates."nginx-mcp-auth.conf" = {
content = ''
if ($http_x_api_key != "${config.sops.placeholder."LLAMA_API_KEY"}") {
return 401 '{"error": "Unauthorized"}';
}
'';
owner = "nginx";
};
modules.system = {
nginx = {
enable = true;