From 675f2745a4b86a7eb28cce035e621a80bf02e95b Mon Sep 17 00:00:00 2001 From: xiaolitongxue666 Date: Wed, 19 Nov 2025 20:21:41 +0800 Subject: [PATCH] feat: add coze api proxy route --- conf/alchemy/ai.conf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/conf/alchemy/ai.conf b/conf/alchemy/ai.conf index 30bc339..5237734 100644 --- a/conf/alchemy/ai.conf +++ b/conf/alchemy/ai.conf @@ -49,4 +49,21 @@ server { proxy_pass http://127.0.0.1:5000/; } + + location /api/v1/coze/ { + proxy_set_header Host $host; + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always; + add_header Access-Control-Allow-Headers 'Authorization,HtyAdminToken,HtySudoerToken,HtyHost,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Max-Age 86400 always; + if ($request_method = 'OPTIONS') { + return 200; + } + +# auth_basic "coze_api access auth"; +# auth_basic_user_file /usr/local/openresty/nginx/conf.d/.htpasswd; + + proxy_pass http://127.0.0.1:6000/; + } }