# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: ChatGPT Plus
spec:
    description: 基于 AI 大语言模型 API 实现的 AI 助手全套开源解决方案，自带运营管理后台，开箱即用。集成了 OpenAI, Azure, ChatGLM,讯飞星火，文心一言等多个平台的大语言模型。集成了 MidJourney 和 Stable Diffusion AI绘画功能
    coverImage: https://github.com/yangjian102621/chatgpt-plus/raw/3d37a3d36781aecc2e20d80783deb19f283d1c89/docs/imgs/chat-new.png
    icon: https://raw.githubusercontent.com/yangjian102621/chatgpt-plus/main/web/public/images/logo.png
    tags:
        - Website
    readme: |
        # ChatGPT Plus

        ## 设定项

        打开 Settings > Configuration Editor 进行修改。

        ### ChatGPT Plus API

        可选择性配置短信服务，让用户可以用手机号注册。

        ```
        [SMS] # Sms 配置，用于发送短信
           Active = "Ali" # 当前启用的短信服务，默认使用阿里云
           [SMS.Ali]
              AccessKey = ""
              AccessSecret = ""
              Product = "Dysmsapi"
              Domain = "dysmsapi.aliyuncs.com"
              Sign = ""
              CodeTempId = ""
        ```

        OSS 可选择性使用 Minio 提升文件保存可靠性。

        ```
        [OSS] # OSS 配置，用于存储 MJ 绘画图片
           Active = "MINIO" # 默认使用本地文件存储引擎
           [OSS.Minio]
             Endpoint = "" # 如 172.22.11.200:9000
             AccessKey = "" # 自己去 Minio 控制台去创建一个 Access Key
             AccessSecret = ""
             Bucket = "chatgpt-plus" # 替换为你自己创建的 Bucket，注意要给 Bucket 设置公开的读权限，否则会出现图片无法显示。
             UseSSL = false
             Domain = "" # 地址必须是能够通过公网访问的，否则会出现图片无法显示。
        ```

        另外配置文件中也有其他支付相关的配置，可参考注解修改。

        ### Midjourney Proxy

        在环境变量 (Variable) 中，配置 Discord 连接 Midjourney 的相关信息：

        ```
        mj_discord_guild_id=Discord服务器ID
        mj_discord_channel_id=Discord频道ID
        mj_discord_user_token=Discord用户令牌
        ```

        ### XXL-JOB Admin

        可选择性配置 email server 用来收取任务日志信息。

        ```
        ### xxl-job, email
        spring.mail.host=smtp.qq.com
        spring.mail.port=25
        spring.mail.username=xxx@qq.com
        spring.mail.from=xxx@qq.com
        spring.mail.password=xxx
        ```
    services:
        - name: MySQL
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/mysql.svg
          template: PREBUILT
          spec:
            source:
                image: mysql:8.0.33
            ports:
                - id: database
                  port: 3306
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/mysql
            instructions:
                - title: Command to connect to your MySQL
                  content: mysqlsh --sql --host=${PORT_FORWARDED_HOSTNAME} --port=${DATABASE_PORT_FORWARDED_PORT} --user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} --schema=${MYSQL_DATABASE}
                - title: MySQL username
                  content: ${MYSQL_USERNAME}
                - title: MySQL password
                  content: ${MYSQL_PASSWORD}
                - title: MySQL database
                  content: ${MYSQL_DATABASE}
                - title: MySQL host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: MySQL port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                MYSQL_DATABASE:
                    default: zeabur
                    expose: true
                MYSQL_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                MYSQL_PASSWORD:
                    default: ${MYSQL_ROOT_PASSWORD}
                    expose: true
                MYSQL_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                MYSQL_ROOT_PASSWORD:
                    default: ${PASSWORD}
                MYSQL_USERNAME:
                    default: root
                    expose: true
            configs:
                - path: /etc/my.cnf
                  template: |
                    [mysqld]
                    default-authentication-plugin=mysql_native_password
                    skip-host-cache
                    skip-name-resolve
                    datadir=/var/lib/mysql
                    socket=/var/run/mysqld/mysqld.sock
                    secure-file-priv=/var/lib/mysql-files
                    user=mysql
                    max_allowed_packet=10M

                    pid-file=/var/run/mysqld/mysqld.pid
                    [client]
                    socket=/var/run/mysqld/mysqld.sock

                    !includedir /etc/mysql/conf.d/
                  permission: null
                  envsubst: null
        - name: Redis
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/redis.svg
          template: PREBUILT
          spec:
            source:
                image: redis/redis-stack-server:latest
            ports:
                - id: database
                  port: 6379
                  type: TCP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Command to connect to your Redis
                  content: redis-cli -h ${PORT_FORWARDED_HOSTNAME} -p ${DATABASE_PORT_FORWARDED_PORT} -a ${REDIS_PASSWORD}
                - title: Redis Connection String
                  content: redis://:${REDIS_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}
                - title: Redis password
                  content: ${REDIS_PASSWORD}
                - title: Redis host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: Redis port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                REDIS_ARGS:
                    default: --requirepass ${REDIS_PASSWORD}
                REDIS_CONNECTION_STRING:
                    default: redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}
                    expose: true
                REDIS_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                REDIS_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                REDIS_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                REDIS_URI:
                    default: ${REDIS_CONNECTION_STRING}
                    expose: true
        - name: XXL-JOB Admin (Migrate)
          icon: https://www.xuxueli.com/doc/static/xxl-job/images/xxl-logo.jpg
          template: PREBUILT
          spec:
            source:
                image: mysql
                command:
                    - /bin/bash
                args:
                    - /usr/bin/migrate-script.sh
            configs:
                - path: /usr/bin/migrate-script.sh
                  template: |
                    DB_NAME="xxl_job"
                    MIGRATION_FILE_URL="https://raw.githubusercontent.com/xuxueli/xxl-job/1af1e82f0e54ff1700abb0b6ffb780dc7349e9ca/doc/db/tables_xxl_job.sql"
                    MIGRATION_FILE="/tmp/xxl_job_2.4.2.sql"

                    # Check if the database exists
                    echo "Checking if database $DB_NAME exists..."

                    if mysqlsh --user=$MYSQL_USERNAME --password=$MYSQL_PASSWORD --host=$MYSQL_HOST --port=$MYSQL_PORT --sql -e "USE $DB_NAME" 2>&1 | grep -q "Unknown database"; then
                      echo "Database $DB_NAME does not exist. Running migration..."

                      # Run the migration SQL file
                      echo "Downloading migration files..."
                      microdnf -y install curl

                      curl -o $MIGRATION_FILE $MIGRATION_FILE_URL
                      mysqlsh --user=$MYSQL_USERNAME --password=$MYSQL_PASSWORD --host=$MYSQL_HOST --port=$MYSQL_PORT --sql -f $MIGRATION_FILE

                      if [ $? -eq 0 ]; then
                        echo "Migration completed successfully."
                      else
                        echo "Migration failed."
                      fi
                    else
                      echo "Database $DB_NAME already exists. No migration needed."
                    fi
                  permission: null
                  envsubst: null
        - name: XXL-JOB Admin
          icon: https://www.xuxueli.com/doc/static/xxl-job/images/xxl-logo.jpg
          template: PREBUILT
          spec:
            source:
                image: xuxueli/xxl-job-admin:2.4.1
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            volumes:
                - id: logs
                  dir: /data/applogs
            env:
                PARAMS:
                    default: --spring.config.location=/application.properties
                XXL_JOB_EXECUTOR_API_TOKEN:
                    default: ${PASSWORD}
                    expose: true
            configs:
                - path: /application.properties
                  template: |
                    ### web
                    server.port=8080
                    server.servlet.context-path=/xxl-job-admin

                    ### actuator
                    management.server.servlet.context-path=/actuator
                    management.health.mail.enabled=false

                    ### resources
                    spring.mvc.servlet.load-on-startup=0
                    spring.mvc.static-path-pattern=/static/**
                    spring.resources.static-locations=classpath:/static/

                    ### freemarker
                    spring.freemarker.templateLoaderPath=classpath:/templates/
                    spring.freemarker.suffix=.ftl
                    spring.freemarker.charset=UTF-8
                    spring.freemarker.request-context-attribute=request
                    spring.freemarker.settings.number_format=0.##########
                    spring.freemarker.settings.new_builtin_class_resolver=safer

                    ### mybatis
                    mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
                    #mybatis.type-aliases-package=com.xxl.job.admin.core.model

                    ### xxl-job, datasource
                    spring.datasource.url=jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
                    spring.datasource.username=${MYSQL_USERNAME}
                    spring.datasource.password=${MYSQL_PASSWORD}
                    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

                    ### datasource-pool
                    spring.datasource.type=com.zaxxer.hikari.HikariDataSource
                    spring.datasource.hikari.minimum-idle=10
                    spring.datasource.hikari.maximum-pool-size=30
                    spring.datasource.hikari.auto-commit=true
                    spring.datasource.hikari.idle-timeout=30000
                    spring.datasource.hikari.pool-name=HikariCP
                    spring.datasource.hikari.max-lifetime=900000
                    spring.datasource.hikari.connection-timeout=10000
                    spring.datasource.hikari.connection-test-query=SELECT 1
                    spring.datasource.hikari.validation-timeout=1000

                    ### xxl-job, email
                    spring.mail.host=smtp.qq.com
                    spring.mail.port=25
                    spring.mail.username=xxx@qq.com
                    spring.mail.from=xxx@qq.com
                    spring.mail.password=xxx
                    spring.mail.properties.mail.smtp.auth=true
                    spring.mail.properties.mail.smtp.starttls.enable=true
                    spring.mail.properties.mail.smtp.starttls.required=true
                    spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

                    ### xxl-job, access token
                    xxl.job.accessToken=${XXL_JOB_EXECUTOR_API_TOKEN}

                    ### xxl-job, i18n (default is zh_CN, and you can choose "zh_CN", "zh_TC" and "en")
                    xxl.job.i18n=zh_CN

                    ## xxl-job, triggerpool max size
                    xxl.job.triggerpool.fast.max=200
                    xxl.job.triggerpool.slow.max=100

                    ### xxl-job, log retention days
                    xxl.job.logretentiondays=30
                  permission: null
                  envsubst: null
        - name: Midjourney Proxy
          icon: https://upload.wikimedia.org/wikipedia/commons/2/24/Midjourney_Emblem.svg
          template: PREBUILT
          spec:
            source:
                image: novicezk/midjourney-proxy:2.6.2
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            instructions:
                - title: Midjourney Proxy API endpoint
                  content: ${ZEABUR_WEB_URL}/mj
                - title: Midjourney Proxy API secret
                  content: ${MIDJOURNEY_PROXY_APISECRET}
            env:
                MIDJOURNEY_PROXY_APISECRET:
                    default: ${mj_api_secret}
                    expose: true
                mj_api_secret:
                    default: ${PASSWORD}
                mj_discord_channel_id:
                    default: ""
                mj_discord_guild_id:
                    default: ""
                mj_discord_user_token:
                    default: ""
        - name: ChatGPT Plus API (Migrate)
          icon: https://raw.githubusercontent.com/yangjian102621/chatgpt-plus/main/web/public/images/logo.png
          template: PREBUILT
          spec:
            source:
                image: mysql
                command:
                    - /bin/bash
                args:
                    - /usr/bin/migrate-script.sh
            configs:
                - path: /usr/bin/migrate-script.sh
                  template: |
                    DB_NAME="chatgpt_plus"
                    MIGRATION_FILES=(
                      "https://raw.githubusercontent.com/yangjian102621/chatgpt-plus/3d37a3d36781aecc2e20d80783deb19f283d1c89/database/chatgpt_plus-v4.0.2.sql"
                      "https://raw.githubusercontent.com/yangjian102621/chatgpt-plus/3d37a3d36781aecc2e20d80783deb19f283d1c89/database/update-v4.0.3.sql"
                    )

                    set -e

                    # Check if the database exists
                    echo "Checking if database $DB_NAME exists..."

                    if mysqlsh --user=$MYSQL_USERNAME --password=$MYSQL_PASSWORD --host=$MYSQL_HOST --port=$MYSQL_PORT --sql -e "USE $DB_NAME" 2>&1 | grep -q "Unknown database"; then
                      echo "Database $DB_NAME does not exist. Running migration..."

                      # download all migration files and concatenate them into a single file
                      echo "Downloading migration files..."
                      microdnf -y install curl

                      MIGRATION_FILE="migrations.sql"
                      for url in "${MIGRATION_FILES[@]}"; do
                        echo "Downloading migration file $url..."
                        curl -s $url >> $MIGRATION_FILE
                      done

                      # Run the migration SQL file
                      echo "Running migration file $MIGRATION_FILE..."
                      mysqlsh --user=$MYSQL_USERNAME --password=$MYSQL_PASSWORD --host=$MYSQL_HOST --port=$MYSQL_PORT --sql -f $MIGRATION_FILE

                      if [ $? -eq 0 ]; then
                        echo "Migration completed successfully."
                      else
                        echo "Migration failed."
                      fi
                    else
                      echo "Database $DB_NAME already exists. No migration needed."
                    fi
                  permission: null
                  envsubst: null
        - name: ChatGPT Plus API
          icon: https://raw.githubusercontent.com/yangjian102621/chatgpt-plus/main/web/public/images/logo.png
          template: PREBUILT
          spec:
            source:
                image: registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-api:v4.0.3-amd64
                command:
                    - /bin/sh
                args:
                    - /var/www/app/docker-entrypoint.sh
            ports:
                - id: web
                  port: 5678
                  type: HTTP
                - id: executor
                  port: 9999
                  type: TCP
            volumes:
                - id: logs
                  dir: /var/www/app/logs
                - id: static
                  dir: /var/www/app/static
                - id: leveldb
                  dir: /var/www/app/data
            instructions:
                - title: ChatGPT Plus API Executor Hostname
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: ChatGPT Plus API Executor Password
                  content: ${EXECUTOR_PORT_FORWARDED_PORT}
            env:
                CONFIG_FILE:
                    default: config.toml
                DEBUG:
                    default: "false"
                JWT_SECRET_KEY:
                    default: ${PASSWORD}
                LOG_LEVEL:
                    default: info
            configs:
                - path: /var/www/app/docker-entrypoint.sh
                  template: |
                    set -e

                    if [ -f /var/www/app/config.toml.inc ]; then
                      echo "Build config.toml from config.toml.inc"
                      apk add --no-cache envsubst
                      cat /var/www/app/config.toml.inc | envsubst | tee /var/www/app/config.toml
                    fi

                    /var/www/app/chatgpt-plus-linux
                  permission: null
                  envsubst: null
                - path: /var/www/app/config.toml.inc
                  template: |
                    Listen = "0.0.0.0:5678"
                    ProxyURL = "" # 如 http://127.0.0.1:7777
                    MysqlDns = "${MYSQL_USERNAME}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/chatgpt_plus?charset=utf8mb4&collation=utf8mb4_unicode_ci&parseTime=True&loc=Local"
                    StaticDir = "./static" # 静态资源的目录
                    StaticUrl = "/static" # 静态资源访问 URL
                    AesEncryptKey = ""
                    WeChatBot = false

                    [Session]
                      SecretKey = "${JWT_SECRET_KEY}" # 注意：这个是 JWT Token 授权密钥，生产环境请务必更换
                      MaxAge = 86400

                    [Redis] # redis 配置信息
                      Host = "${REDIS_HOST}"
                      Port = ${REDIS_PORT}
                      Password = "${REDIS_PASSWORD}"
                      DB = 0

                    [ApiConfig] # 微博热搜，今日头条等函数服务 API 配置，此为第三方插件服务，如需使用请联系作者开通
                      ApiURL = ""
                      AppId = ""
                      Token = ""


                    [SMS] # Sms 配置，用于发送短信
                       Active = "Ali" # 当前启用的短信服务，默认使用阿里云
                       [SMS.Bao]
                          Username = ""
                          Password = ""
                          Domain = "api.smsbao.com"
                          Sign = "【极客学长】"
                          CodeTemplate = "您的验证码是{code}。5分钟有效，若非本人操作，请忽略本短信。"
                       [SMS.Ali]
                          AccessKey = ""
                          AccessSecret = ""
                          Product = "Dysmsapi"
                          Domain = "dysmsapi.aliyuncs.com"
                          Sign = ""
                          CodeTempId = ""

                    [OSS] # OSS 配置，用于存储 MJ 绘画图片
                       Active = "LOCAL" # 默认使用本地文件存储引擎
                       [OSS.Local]
                         BasePath = "./static/upload" # 本地文件上传根路径
                         BaseURL = "${ZEABUR_WEB_URL}/static/upload" # 本地上传文件前缀 URL，线上需要把 localhost 替换成自己的实际域名或者IP
                       [OSS.Minio]
                         Endpoint = "" # 如 172.22.11.200:9000
                         AccessKey = "" # 自己去 Minio 控制台去创建一个 Access Key
                         AccessSecret = ""
                         Bucket = "chatgpt-plus" # 替换为你自己创建的 Bucket，注意要给 Bucket 设置公开的读权限，否则会出现图片无法显示。
                         UseSSL = false
                         Domain = "" # 地址必须是能够通过公网访问的，否则会出现图片无法显示。
                       [OSS.QiNiu] # 七牛云 OSS 配置
                           Zone = "z2" # 区域，z0：华东，z1: 华北，na0：北美，as0：新加坡
                           AccessKey = ""
                           AccessSecret = ""
                           Bucket = ""
                           Domain = "" # OSS Bucket 所绑定的域名，如 https://img.r9it.com
                       [OSS.AliYun]
                           Endpoint = "oss-cn-hangzhou.aliyuncs.com"
                           AccessKey = ""
                           AccessSecret = ""
                           Bucket = "chatgpt-plus"
                           SubDir = ""
                           Domain = ""

                    [[MjProxyConfigs]]
                      Enabled = true
                      ApiURL = "http://midjourney-proxy.zeabur.internal:8080"
                      ApiKey = "${MIDJOURNEY_PROXY_APISECRET}"

                    [[MjPlusConfigs]]
                      Enabled = false
                      ApiURL = "https://api.chat-plus.net"
                      Mode = "fast" # MJ 绘画模式，可选值 relax/fast/turbo
                      ApiKey = "sk-xxx"

                    [[SdConfigs]]
                      Enabled = false
                      ApiURL = ""
                      ApiKey = ""
                      Txt2ImgJsonPath = "res/sd/text2img.json"

                    [XXLConfig] # xxl-job 配置，需要你部署 XXL-JOB 定时任务工具，用来定期清理未支付订单和清理过期 VIP，如果你没有启用支付服务，则该服务也无需启动
                      Enabled = true # 是否启用 XXL JOB 服务
                      ServerAddr = "http://xxl-job-admin.zeabur.internal:8080/xxl-job-admin" # xxl-job-admin 管理地址
                      ExecutorIp = "chatgpt-plus-api.zeabur.internal" # 执行器 IP 地址
                      ExecutorPort = "9999" # 执行器服务端口
                      AccessToken = "${XXL_JOB_EXECUTOR_API_TOKEN}" # 执行器 API 通信 token
                      RegistryKey = "chatgpt-plus" # 任务注册 key

                    [AlipayConfig]
                      Enabled = false # 启用支付宝支付通道
                      SandBox = false # 是否启用沙盒模式
                      UserId = "2088721020750581" # 商户ID
                      AppId = "9021000131658023" # App Id
                      PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
                      PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
                      AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
                      RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
                      NotifyURL = "https://ai.r9it.com/api/payment/alipay/notify" # 支付异步回调地址

                    [HuPiPayConfig]
                      Enabled = false
                      Name = "wechat"
                      AppId = ""
                      AppSecret = ""
                      ApiURL = "https://api.xunhupay.com"
                      NotifyURL = "https://ai.r9it.com/api/payment/hupipay/notify"

                    [SmtpConfig] # 注意，阿里云服务器禁用了25号端口，所以如果需要使用邮件功能，请别用阿里云服务器
                      Host = "smtp.163.com"
                      Port = 25
                      AppName = "极客学长"
                      From = "test@163.com" # 发件邮箱人地址
                      Password = "" #邮箱 stmp 服务授权码

                    [JPayConfig] # PayJs 支付配置
                      Enabled = false
                      Name = "wechat" # 请不要改动
                      AppId = "" # 商户 ID
                      PrivateKey = "" # 秘钥
                      ApiURL = "https://payjs.cn"
                      NotifyURL = "https://ai.r9it.com/api/payment/payjs/notify" # 异步回调地址，域名改成你自己的
                  permission: null
                  envsubst: null
        - name: ChatGPT Plus (Web)
          icon: https://raw.githubusercontent.com/yangjian102621/chatgpt-plus/main/web/public/images/logo.png
          template: PREBUILT
          spec:
            source:
                image: registry.cn-shenzhen.aliyuncs.com/geekmaster/chatgpt-plus-web:v4.0.3-amd64
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            configs:
                - path: /etc/nginx/nginx.conf
                  template: |
                    worker_processes  5;
                    error_log  stderr;
                    worker_rlimit_nofile 8192;

                    events {
                    	worker_connections 768;
                    	# multi_accept on;
                    }

                    http {
                      log_format   main '$remote_addr - $remote_user [$time_local]  $status '
                        '"$request" $body_bytes_sent "$http_referer" '
                        '"$http_user_agent" "$http_x_forwarded_for"';
                      access_log   /dev/stdout  main;
                      sendfile     on;
                      tcp_nopush   on;
                      types_hash_max_size 2048;
                      client_max_body_size 100M;
                      server_names_hash_bucket_size 128; # this seems to be required for some vhosts

                    	include /etc/nginx/mime.types;
                    	default_type application/octet-stream;

                      gzip on;
                    	gzip_min_length 1k;
                    	gzip_vary on;
                    	gzip_proxied any;
                    	gzip_comp_level 6;
                    	gzip_buffers 16 8k;
                    	gzip_http_version 1.1;
                    	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


                      map $http_upgrade $connection_upgrade {
                        default upgrade;
                        'websocket'      upgrade;
                      }

                      server {
                        listen 8080;
                        server_name _;

                        index index.html;
                        root /var/www/app/dist;

                        location / {
                          try_files $uri $uri/ /index.html;

                          # 后端 API 的转发
                          location /api/ {
                            proxy_http_version 1.1;
                            proxy_connect_timeout 300s;
                            proxy_read_timeout 300s;
                            proxy_send_timeout 12s;
                            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_set_header Upgrade $http_upgrade;
                            proxy_set_header Connection $connection_upgrade;
                            proxy_pass http://chatgpt-plus-api.zeabur.internal:5678;
                          }

                          # 静态资源转发
                          location /static/ {
                              proxy_pass http://chatgpt-plus-api.zeabur.internal:5678;
                          }
                        }
                      }
                    }
                  permission: null
                  envsubst: null
