labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.71k stars 4.72k forks source link

如何正确配置Nginx? #2885

Open taowang1993 opened 2 weeks ago

taowang1993 commented 2 weeks ago

我想在云端部署docker-compose-milvus.yaml 请问,以下配置是否正确?我想把Nginx容器加入docker-compose-milvus.yaml ssl证书,我用的是Cloudflare Original Certificates

version: '3.8'

services:

  nginx:
    image: nginx:latest
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf  # 绑定本地配置文件
      - /path/to/certificates/:/etc/nginx/certificates/  # 绑定证书目录
    depends_on:
      - milvus

## 其他services

nginx.conf

events {}

http {
    server {
        listen 80;
        server_name your_domain.com;  # 替换为你的域名

        # 将 HTTP 请求重定向到 HTTPS
        return 301 https://$host$request_uri;
    }

    server {
        listen 443 ssl;
        server_name your_domain.com;  # 替换为你的域名

        ssl_certificate /etc/nginx/certificates/fullchain.pem;  # 替换为你的证书路径
        ssl_certificate_key /etc/nginx/certificates/privkey.pem;  # 替换为你的私钥路径

        location / {
            proxy_pass http://milvus:19530;  # 代理到 Milvus 服务
            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 X-Forwarded-Proto $scheme;
        }
    }
}

作者可否分享一下,云端应用(https://cloud.tryfastgpt.a)的Nginx配置方法

十分感谢!

taowang1993 commented 2 weeks ago

depends_on 这里该填写哪些services?

    depends_on:
      - fastgpt
      - oneapi

这样对吗?

c121914yu commented 3 days ago

没用 nginx,用的 sealos 的 higress,没配置内容。 nginx 看你要代理啥服务,代理 fastgpt,就依赖 fastgpt,然后 proxy_pass 执行 http://fastgpt:3000 即可。