aboutsummaryrefslogtreecommitdiffstats
path: root/src/nginx
diff options
context:
space:
mode:
Diffstat (limited to 'src/nginx')
-rw-r--r--src/nginx/nginx.conf17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nginx/nginx.conf b/src/nginx/nginx.conf
index 2dc6d52..5e411a9 100644
--- a/src/nginx/nginx.conf
+++ b/src/nginx/nginx.conf
@@ -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;
+ }
+ }
}