fix: 更新nginx配置

This commit is contained in:
dolphin
2025-04-19 01:25:06 +08:00
parent 02db1eb868
commit b4371fc4f5
4 changed files with 19 additions and 13 deletions
+10 -9
View File
@@ -18,14 +18,14 @@ server {
listen 3001;
location / {
root /usr/share/nginx/html/platfrom;
location / {
root /usr/share/nginx/html/platform;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
add_header X-Frame-Options SAMEORIGIN;
}
location /api {
location /api {
proxy_pass http://backend:7860;
proxy_read_timeout 300s;
proxy_set_header Host $host;
@@ -39,13 +39,14 @@ server {
add_header X-Frame-Options SAMEORIGIN;
}
location /workbench/ {
location /workspace/ {
alias /usr/share/nginx/html/client/;
index index.html index.htm;
try_files $uri $uri/ /workbench/index.html;
try_files $uri $uri/ /workspace/index.html;
}
location /workbench/api {
rewrite ^/workbench(/.*)$ $1 break;
location /workspace/api {
rewrite ^/workspace(/.*)$ $1 break;
proxy_pass http://backend:7860;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@@ -58,8 +59,8 @@ server {
add_header X-Frame-Options SAMEORIGIN;
}
location ~ ^/(workbench/bisheng|bisheng|tmp-dir)/ {
location ~ ^/(workspace/bisheng|bisheng|tmp-dir)/ {
rewrite ^/workspace(/.*)$ $1 break;
proxy_pass http://minio:9000;
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ server {
listen 3001;
location / {
root /usr/share/nginx/html/platfrom;
root /usr/share/nginx/html/platform;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
add_header X-Frame-Options SAMEORIGIN;
@@ -51,12 +51,18 @@ export const ModelManagement = ({
<div key={model.key} className="grid mb-4 items-start"
style={{ gridTemplateColumns: "repeat(2, 1fr) 40px" }}>
<div className="pr-2" id={model.id}>
{llmOptions.length > 1 && <ModelSelect
{llmOptions.length > 0 ? <ModelSelect
key={model.id}
label={''}
value={model.id}
options={llmOptions}
onChange={(val) => onModelChange(index, val)}
/> : <ModelSelect
key={model.id}
label={''}
value={''}
options={[]}
onChange={(val) => {}}
/>}
{errors[model.key] && <p className="text-red-500 text-xs mt-1">{errors[model.key]?.[0]}</p>}
</div>
+1 -2
View File
@@ -7,8 +7,7 @@ import svgr from "vite-plugin-svgr";
// import { visualizer } from 'rollup-plugin-visualizer';
// Use environment variable to determine the target.
// const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
const target = process.env.VITE_PROXY_TARGET || "http://192.168.106.120:3002";
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
const apiRoutes = ["^/api/", "/health"];
const proxyTargets = apiRoutes.reduce((proxyObj, route) => {