Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多SK-xxx随机,指定域名SK-xxx配置 #84

Open
yuantouw opened this issue Jun 24, 2023 · 0 comments
Open

多SK-xxx随机,指定域名SK-xxx配置 #84

yuantouw opened this issue Jun 24, 2023 · 0 comments

Comments

@yuantouw
Copy link

之前看到有人问,咋多SK-xxx随机,我今天问了下gpt半天好像成功搞出来了,分享给大家。

#默认未指定域名的多sk-xxx设置
split_clients "$remote_addr" $gptauth_random {
33% "Bearer sk-1111";
33% "Bearer sk-222";
34% "Bearer sk-333";
}

#默认sk-xxx调用及指定域名设置sk-111
map $http_host $gptauth {
default $gptauth_random;
#多域名指定sk-xxxx
baidu.com "Bearer sk-aaaaa";
www.baidu.com "Bearer sk-bbbbb";
m.baidu.com "Bearer sk-ccccc";
}

另外,一个服务器里,多个同样的网站只需要在一个网站里设置这一部分即可,反向代理v1/需要每个网站单独设置。

#刚刚搞的自测成功好像没什么毛病,没人分享开心,分享给大家希望想用的能用到。如有什么毛病感谢指证!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant