Closed eureka6 closed 1 year ago
你的basic_auth配置 放到单html配置里看能生效吗 location / {这里, 然后打开网页,输入账号密码能正常进去吗
你的basic_auth配置 放到单html配置里看能生效吗 location / {这里, 然后打开网页,输入账号密码能正常进去吗
这样的话,可以正常使用。
如果把basic_auth放到最外边,或者location ^~ /v1 {
下面,就会报错:API密钥错误或失效,请检查API密钥!
放到location ^~ /v1 { 里就不能用了吗
是的
是的
我知道了。basic_auth也占用Authorization头,如果你不在前端设置api密钥使用的话,proxy_set_header Authorization 这后面改回之前的那个默认密钥。map可以不要 并且把代码里的credentials: "omit"都删掉
可以参考最新文档加密HTML使用
大佬,配置了下面的东西后,Nginx的basic_auth一开启就报错
开启basic_auth后,网页上提示
API密钥错误或失效,请检查API密钥!
关掉basic_auth就又正常了另外,我用的是别人代理的api,需要把nginx配置里的代理地址、请求头之类从
api.openai.com
改成api.openai-sb.com
,还要把sk-
开头的密钥改成了sb-
开头的密钥。这没影响吧?主要是关闭basic_auth就一切都正常。