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

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

Closed
Superqinqing opened this issue Feb 13, 2024 · 4 comments

Comments

@Superqinqing
Copy link

Superqinqing commented Feb 13, 2024

[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
Copy link
Owner

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

@Mackerly
Copy link

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

@nealhan
Copy link

nealhan commented Feb 21, 2024 via email

@Superqinqing
Copy link
Author

我也遇到了这个情况。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/; } }

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

4 participants