You've already forked DataMate
feat: deer-flow通过gateway转发 (#193)
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name 0.0.0.0;
|
||||
|
||||
access_log /var/log/datamate/frontend/access.log main;
|
||||
error_log /var/log/datamate/frontend/error.log notice;
|
||||
|
||||
client_max_body_size 1024M;
|
||||
|
||||
add_header Set-Cookie "NEXT_LOCALE=zh";
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://datamate-gateway:8080/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /chat {
|
||||
proxy_pass http://deer-flow-frontend:3000/chat;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /_next {
|
||||
proxy_pass http://deer-flow-frontend:3000/_next;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /deer-flow-backend/ {
|
||||
proxy_pass http://deer-flow-backend:8000/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
if ($query_string ~* "_rsc=pmmii") {
|
||||
proxy_pass http://deer-flow-frontend:3000;
|
||||
break;
|
||||
}
|
||||
|
||||
root /opt/frontend;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ server {
|
||||
|
||||
client_max_body_size 1024M;
|
||||
|
||||
add_header Set-Cookie "NEXT_LOCALE=zh";
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://datamate-gateway:8080/api/;
|
||||
proxy_set_header Host $host;
|
||||
@@ -14,6 +16,35 @@ server {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /chat {
|
||||
proxy_pass http://datamate-gateway:8080/chat;
|
||||
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_intercept_errors on;
|
||||
error_page 500 501 502 503 504 =200 @static_fallback;
|
||||
}
|
||||
|
||||
location /_next {
|
||||
proxy_pass http://datamate-gateway:8080/_next;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /deer-flow-backend {
|
||||
proxy_pass http://datamate-gateway:8080/deer-flow-backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location @static_fallback {
|
||||
root /opt/frontend;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /opt/frontend;
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
@@ -47,7 +47,7 @@ services:
|
||||
- "30000:80" # nodePort → hostPort
|
||||
volumes:
|
||||
- frontend_log_volume:/var/log/datamate/frontend
|
||||
- ${NGINX_CONF:-./backend.conf}:/etc/nginx/conf.d/backend.conf
|
||||
- ./backend.conf:/etc/nginx/conf.d/backend.conf
|
||||
networks: [ datamate ]
|
||||
depends_on:
|
||||
- datamate-backend
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{{- if .Values.global.deerFlow.enable }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
@@ -24,62 +23,36 @@ data:
|
||||
}
|
||||
|
||||
location /chat {
|
||||
proxy_pass http://deer-flow-frontend:3000/chat;
|
||||
proxy_pass http://datamate-gateway:8080/chat;
|
||||
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_intercept_errors on;
|
||||
error_page 500 501 502 503 504 =200 @static_fallback;
|
||||
}
|
||||
|
||||
location /_next {
|
||||
proxy_pass http://deer-flow-frontend:3000/_next;
|
||||
proxy_pass http://datamate-gateway:8080/_next;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location /deer-flow-backend/ {
|
||||
proxy_pass http://deer-flow-backend:8000/api/;
|
||||
location /deer-flow-backend {
|
||||
proxy_pass http://datamate-gateway:8080/deer-flow-backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
if ($query_string ~* "_rsc=pmmii") {
|
||||
proxy_pass http://deer-flow-frontend:3000;
|
||||
break;
|
||||
}
|
||||
|
||||
location @static_fallback {
|
||||
root /opt/frontend;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
{{- else }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: datamate-nginx-conf
|
||||
data:
|
||||
backend.conf: |
|
||||
server {
|
||||
listen 80;
|
||||
server_name 0.0.0.0;
|
||||
|
||||
access_log /var/log/datamate/frontend/access.log main;
|
||||
error_log /var/log/datamate/frontend/error.log notice;
|
||||
|
||||
client_max_body_size 1024M;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://datamate-gateway:8080/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /opt/frontend;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
{{- end }}
|
||||
}
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
global:
|
||||
namespace: datamate
|
||||
deerFlow:
|
||||
enable: false
|
||||
image:
|
||||
repository: "ghcr.io/modelengine-group/"
|
||||
pullPolicy: "IfNotPresent"
|
||||
|
||||
Reference in New Issue
Block a user