geqintan commited on
Commit
1ed6f05
·
1 Parent(s): 3d0a022
Dockerfile CHANGED
@@ -1,3 +1,5 @@
 
 
1
  # 基于OpenResty基础镜像
2
  FROM openresty/openresty:1.21.4.1-0-jammy
3
 
 
1
+ # 目前已经实现静态的gemini代理,下面需要使用lua实现动态替换 备份时间为 2025-02-26 00:03
2
+
3
  # 基于OpenResty基础镜像
4
  FROM openresty/openresty:1.21.4.1-0-jammy
5
 
bak/2025-02-26 0003 实现静态gemini访问,cline可用/Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 目前已经实现静态的gemini代理,下面需要使用lua实现动态替换 备份时间为 2025-02-26 00:03
2
+
3
+ # 基于OpenResty基础镜像
4
+ FROM openresty/openresty:1.21.4.1-0-jammy
5
+
6
+ # 安装必要的包(可选)
7
+ RUN apt-get update && apt-get install -y \
8
+ curl \
9
+ vim \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # 创建用户
13
+ RUN useradd -m -s /bin/bash myuser
14
+
15
+ # 创建目录
16
+ RUN mkdir -p /data/myapp
17
+ # RUN mkdir -p /usr/local/openresty/nginx/client_body_temp
18
+ RUN mkdir -p /usr/local/openresty/nginx
19
+
20
+ # 修改目录的所有者和权限
21
+ RUN chown -R myuser:myuser /data/myapp
22
+ RUN chmod -R 755 /data/myapp
23
+ RUN chown -R myuser:myuser /usr/local/openresty/nginx
24
+ RUN chmod -R 755 /usr/local/openresty/nginx
25
+
26
+ # 设置工作目录
27
+ WORKDIR /data/myapp
28
+
29
+ # 切换到新用户
30
+ USER myuser
31
+
32
+ # 复制Lua脚本和nginx配置文件到容器中
33
+ COPY app.lua /data/myapp/
34
+ # COPY app_v1.lua /data/myapp/
35
+ COPY get_ups.lua /usr/local/openresty/nginx/
36
+ COPY app /data/myapp/app
37
+ COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
38
+
39
+ # 指定容器启动时运行的命令
40
+ CMD ["openresty", "-g", "daemon off;"]
bak/2025-02-26 0003 实现静态gemini访问,cline可用/nginx.conf ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 目前已经实现静态的gemini代理,下面需要使用lua实现动态替换 备份时间为 2025-02-26 00:03
2
+ worker_processes auto;
3
+ events {
4
+ worker_connections 1024;
5
+ }
6
+
7
+ http {
8
+ include mime.types;
9
+ default_type application/octet-stream;
10
+
11
+ sendfile on;
12
+ keepalive_timeout 65;
13
+
14
+ server {
15
+ listen 7860;
16
+ server_name localhost;
17
+
18
+ location / {
19
+
20
+ default_type text/html;
21
+ rewrite ^/v1/https/generativelanguage.googleapis.com/(.*)$ /$1 break; # 裁剪路径
22
+ proxy_pass https://generativelanguage.googleapis.com/;
23
+ proxy_set_header Host generativelanguage.googleapis.com;
24
+ # 设置其他常用的请求头
25
+ proxy_set_header X-Real-IP $remote_addr;
26
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
27
+ proxy_set_header X-Forwarded-Proto $scheme;
28
+ }
29
+ }
30
+ }
nginx.conf CHANGED
@@ -1,3 +1,4 @@
 
1
  worker_processes auto;
2
  events {
3
  worker_connections 1024;
 
1
+ # 目前已经实现静态的gemini代理,下面需要使用lua实现动态替换 备份时间为 2025-02-26 00:03
2
  worker_processes auto;
3
  events {
4
  worker_connections 1024;