Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
Add Nginx reverse proxy example
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Feb 1, 2024
1 parent 2132932 commit 1c47cd4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ REACT_APP_GEMINI_API_KEY="你的密钥"
- 若要使用 Nginx 反向代理,请将 `.env` 中的 `REACT_APP_GEMINI_API_URL` 修改为反向代理后的地址,例如 `https://example.org/api`
- 若要使用集成的 PHP 反向代理,请将 `.env` 中的 `REACT_APP_GEMINI_API_URL` 字段修改为 `/gemini.php?token=<访问密码>&path=`,其中 `<访问密码>` 不同于 Gemini API 密钥,需自行于 `public/gemini.php` 中修改。

若要使用 Nginx 反向代理,路径以 `/api` 为例,示例如下:

```nginx
location /api {
proxy_buffering off;
proxy_http_version 1.1;
proxy_read_timeout 86400s;
proxy_cache off; # 注意关闭缓存
proxy_pass https://generativelanguage.googleapis.com/;
}
```

## 开源许可

本项目基于 MIT 协议开源,具体请参阅 [LICENSE](https://github.com/bclswl0827/ChatGemini/blob/master/LICENSE)

0 comments on commit 1c47cd4

Please sign in to comment.