Skip to content

Commit b4371fc

Browse files
committed
fix: 更新nginx配置
1 parent 02db1eb commit b4371fc

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

docker/nginx/conf.d/default.conf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ server {
1818

1919
listen 3001;
2020

21-
location / {
22-
root /usr/share/nginx/html/platfrom;
21+
location / {
22+
root /usr/share/nginx/html/platform;
2323
index index.html index.htm;
2424
try_files $uri $uri/ /index.html =404;
2525
add_header X-Frame-Options SAMEORIGIN;
2626
}
2727

28-
location /api {
28+
location /api {
2929
proxy_pass http://backend:7860;
3030
proxy_read_timeout 300s;
3131
proxy_set_header Host $host;
@@ -39,13 +39,14 @@ server {
3939
add_header X-Frame-Options SAMEORIGIN;
4040
}
4141

42-
location /workbench/ {
42+
location /workspace/ {
4343
alias /usr/share/nginx/html/client/;
4444
index index.html index.htm;
45-
try_files $uri $uri/ /workbench/index.html;
45+
try_files $uri $uri/ /workspace/index.html;
4646
}
47-
location /workbench/api {
48-
rewrite ^/workbench(/.*)$ $1 break;
47+
48+
location /workspace/api {
49+
rewrite ^/workspace(/.*)$ $1 break;
4950
proxy_pass http://backend:7860;
5051
proxy_set_header Host $host;
5152
proxy_set_header X-Real-IP $remote_addr;
@@ -58,8 +59,8 @@ server {
5859
add_header X-Frame-Options SAMEORIGIN;
5960
}
6061

61-
62-
location ~ ^/(workbench/bisheng|bisheng|tmp-dir)/ {
62+
location ~ ^/(workspace/bisheng|bisheng|tmp-dir)/ {
63+
rewrite ^/workspace(/.*)$ $1 break;
6364
proxy_pass http://minio:9000;
6465
}
6566
}

src/frontend/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ server {
1919
listen 3001;
2020

2121
location / {
22-
root /usr/share/nginx/html/platfrom;
22+
root /usr/share/nginx/html/platform;
2323
index index.html index.htm;
2424
try_files $uri $uri/ /index.html =404;
2525
add_header X-Frame-Options SAMEORIGIN;

src/frontend/platform/src/pages/BuildPage/bench/ModelManagement.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ export const ModelManagement = ({
5151
<div key={model.key} className="grid mb-4 items-start"
5252
style={{ gridTemplateColumns: "repeat(2, 1fr) 40px" }}>
5353
<div className="pr-2" id={model.id}>
54-
{llmOptions.length > 1 && <ModelSelect
54+
{llmOptions.length > 0 ? <ModelSelect
5555
key={model.id}
5656
label={''}
5757
value={model.id}
5858
options={llmOptions}
5959
onChange={(val) => onModelChange(index, val)}
60+
/> : <ModelSelect
61+
key={model.id}
62+
label={''}
63+
value={''}
64+
options={[]}
65+
onChange={(val) => {}}
6066
/>}
6167
{errors[model.key] && <p className="text-red-500 text-xs mt-1">{errors[model.key]?.[0]}</p>}
6268
</div>

src/frontend/platform/vite.config.mts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import svgr from "vite-plugin-svgr";
77
// import { visualizer } from 'rollup-plugin-visualizer';
88

99
// Use environment variable to determine the target.
10-
// const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
11-
const target = process.env.VITE_PROXY_TARGET || "http://192.168.106.120:3002";
10+
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860";
1211
const apiRoutes = ["^/api/", "/health"];
1312

1413
const proxyTargets = apiRoutes.reduce((proxyObj, route) => {

0 commit comments

Comments
 (0)