bclswl0827 / ChatGemini

✨ ChatGemini 是一个基于 Google Gemini 的网页客户端,对标 ChatGPT 3.5,操作逻辑同 ChatGPT 3.5 一致,同时支持在聊天中上传图片,应用会自动调用 Gemini-Pro-Vision 模型进行识图。
http://ibcl.us/ChatGemini/
MIT License
904 stars 247 forks source link

为什么国内就不能访问呢,即使我是搭建在国外VPS上的 #20

Closed Superqinqing closed 5 months ago

Superqinqing commented 5 months ago

[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: [400 ] User location is not supported for the API use. 难道只能使用代理访问?

bclswl0827 commented 5 months ago

本应用默认直连 Google API,请仔细阅读 README 说明配置反代,方可在中国使用

Mackerly commented 4 months ago

我也遇到了这个情况。docker部署在美国vps上,然后nginx反向代理到dockers容器的网络和端口。不知道怎么修改才能直接使用。

nealhan commented 4 months ago

服务器端口确保是开的吧?有的服务器,需要提交工单到服务商那里,注明要开通放行某个端口的。

On Wed, Feb 21, 2024 at 3:59 PM Mackerly @.***> wrote:

我也遇到了这个情况。docker部署在美国vps上,然后nginx反向代理到dockers容器的网络和端口。不知道怎么修改才能直接使用。

— Reply to this email directly, view it on GitHub https://github.com/bclswl0827/ChatGemini/issues/20#issuecomment-1956080334, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7TGF7KSKSXMKAN7ELKRUDYUWSMVAVCNFSM6AAAAABDFZ3OIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJWGA4DAMZTGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Superqinqing commented 4 months ago

我也遇到了这个情况。docker部署在美国vps上,然后nginx反向代理到dockers容器的网络和端口。不知道怎么修改才能直接使用。

后来发现是我的VPS的问题,我那个vps就是连不上谷歌api,换了一个vps就可以了,nginx配置可参考 `server { listen 80;

换成自己的域名

server_name xxx.xxx.com;
#网站根目录
location / {
    proxy_ssl_name $host;
    proxy_ssl_server_name on;
    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_http_version 1.1;
    proxy_read_timeout 86400s;
    proxy_cache off; # 注意关闭缓存
    proxy_buffering off; # 注意关闭缓冲
    proxy_pass http://localhost:8080/;
}

}`