有大佬反代了gemini的api吗?nginx如何成功?
本帖最后由 三月七 于 2024-10-7 00:00 编辑generativelanguage.googleapis.com
这个api直接访问是404,我反代了之后也是,直接挂代理访问api是可以请求的。但是反代但是请求不了。请求也是返回404.
解决了,仅供参考:
location /
{
proxy_pass https://generativelanguage.googleapis.com;
proxy_ssl_server_name on;
proxy_set_header Host generativelanguage.googleapis.com;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
页:
[1]