Expose OpenAI API compatibility using aichat

This commit is contained in:
ben
2025-02-01 13:54:25 +01:00
parent 01f224002e
commit cf09067c15
5 changed files with 47 additions and 5 deletions

View File

@@ -58,4 +58,21 @@ http {
proxy_set_header Connection "upgrade";
}
}
server {
listen 8002;
set $deny 1;
if ($http_authorization = "Bearer $API_KEY") {
set $deny 0;
}
if ($deny) {
return 403;
}
location / {
proxy_pass http://aichat:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}