github-actions[bot] commited on
Commit
1d45550
·
1 Parent(s): 333f76b

Update from GitHub Actions

Browse files
Files changed (4) hide show
  1. .coding-ci.yml +10 -0
  2. Dockerfile +20 -0
  3. app/index.html +9 -0
  4. nginx.conf +103 -0
.coding-ci.yml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ main:
2
+ push:
3
+ - docker:
4
+ image: node:18
5
+ imports: https://godgodgame.coding.net/p/tools/d/oci-private-key/git/tree/master/envs.yml
6
+ stages:
7
+ - name: 环境检查
8
+ script: echo $GITHUB_TOKEN_GK && echo $GITHUB_TOKEN && node -v && npm -v
9
+ - name: 将master分支同步更新到github的master分支
10
+ script: git push https://$GITHUB_TOKEN_GK:[email protected]/zhezzma/nginx-proxy.git HEAD:main
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用官方nginx镜像作为基础镜像
2
+ FROM nginx:alpine
3
+
4
+ # 安装基本工具
5
+ RUN apk add --no-cache curl
6
+
7
+ # 移除默认的nginx配置
8
+ RUN rm /etc/nginx/conf.d/default.conf
9
+
10
+ # 复制自定义的nginx配置
11
+ COPY nginx.conf /etc/nginx/conf.d/
12
+
13
+ # 复制网站文件
14
+ COPY ./app /usr/share/nginx/html
15
+
16
+ # 暴露80端口
17
+ EXPOSE 7860
18
+
19
+ # 启动nginx
20
+ CMD ["nginx", "-g", "daemon off;"]
app/index.html ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ https://api.crazy4.me/gemini/v1/{path} https://generativelanguage.googleapis.com/v1/{path}
4
+ https://api.crazy4.me/gemini/v1beta/{path} https://generativelanguage.googleapis.com/v1beta/{path}
5
+ https://api.crazy4.me/groq/openai/v1/{path} https://api.groq.com/openai/v1/{path}
6
+ https://api.crazy4.me/cohere/v1/{path} https://api.cohere.ai/v1/{path}
7
+ https://api.crazy4.me/xai/v1/{path} https://api.x.ai/v1/{path}
8
+ https://api.crazy4.me/mistral/v1/{path} https://api.mistral.ai/v1/{path}
9
+ https://api.crazy4.me/github/v1/{path} https://models.inference.ai.azure.com/{path}
nginx.conf ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 7860;
3
+ server_name localhost;
4
+
5
+ # 开启gzip压缩
6
+ gzip on;
7
+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
8
+
9
+ # 设置日志路径
10
+ access_log /var/log/nginx/access.log;
11
+ error_log /var/log/nginx/error.log;
12
+
13
+ # 根目录配置
14
+ location / {
15
+ root /usr/share/nginx/html;
16
+ index index.html index.htm;
17
+ try_files $uri $uri/ /index.html;
18
+ }
19
+
20
+ # Gemini v1 路由
21
+ location /gemini/v1/ {
22
+ # 启用限速
23
+ limit_req zone=api_limit burst=20 nodelay;
24
+ limit_req_status 429;
25
+
26
+ proxy_pass https://generativelanguage.googleapis.com/v1/;
27
+ proxy_set_header Host generativelanguage.googleapis.com;
28
+ proxy_set_header X-Real-IP $remote_addr;
29
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
+ }
31
+
32
+ # Gemini v1beta 路由
33
+ location /gemini/v1beta/ {
34
+ # 启用限速
35
+ limit_req zone=api_limit burst=20 nodelay;
36
+ limit_req_status 429;
37
+
38
+ proxy_pass https://generativelanguage.googleapis.com/v1beta/;
39
+ proxy_set_header Host generativelanguage.googleapis.com;
40
+ proxy_set_header X-Real-IP $remote_addr;
41
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42
+ }
43
+
44
+ # Groq OpenAI 路由
45
+ location /groq/openai/v1/ {
46
+ # 启用限速
47
+ limit_req zone=api_limit burst=20 nodelay;
48
+ limit_req_status 429;
49
+
50
+ proxy_pass https://api.groq.com/openai/v1/;
51
+ proxy_set_header Host api.groq.com;
52
+ proxy_set_header X-Real-IP $remote_addr;
53
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
54
+ }
55
+
56
+ # Cohere 路由
57
+ location /cohere/v1/ {
58
+ # 启用限速
59
+ limit_req zone=api_limit burst=20 nodelay;
60
+ limit_req_status 429;
61
+
62
+ proxy_pass https://api.cohere.ai/v1/;
63
+ proxy_set_header Host api.cohere.ai;
64
+ proxy_set_header X-Real-IP $remote_addr;
65
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
66
+ }
67
+
68
+ # XAI 路由
69
+ location /xai/v1/ {
70
+ # 启用限速
71
+ limit_req zone=api_limit burst=20 nodelay;
72
+ limit_req_status 429;
73
+
74
+ proxy_pass https://api.x.ai/v1/;
75
+ proxy_set_header Host api.x.ai;
76
+ proxy_set_header X-Real-IP $remote_addr;
77
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
78
+ }
79
+
80
+ # Mistral 路由
81
+ location /mistral/v1/ {
82
+ # 启用限速
83
+ limit_req zone=api_limit burst=20 nodelay;
84
+ limit_req_status 429;
85
+
86
+ proxy_pass https://api.mistral.ai/v1/;
87
+ proxy_set_header Host api.mistral.ai;
88
+ proxy_set_header X-Real-IP $remote_addr;
89
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
90
+ }
91
+
92
+ # GitHub 路由
93
+ location /github/v1/ {
94
+ # 启用限速
95
+ limit_req zone=api_limit burst=20 nodelay;
96
+ limit_req_status 429;
97
+
98
+ proxy_pass https://models.inference.ai.azure.com/;
99
+ proxy_set_header Host models.inference.ai.azure.com;
100
+ proxy_set_header X-Real-IP $remote_addr;
101
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
102
+ }
103
+ }