fix nginx
This commit is contained in:
parent
bc06725ed1
commit
9ad2ac80bf
1
frontend/.env.development
Normal file
1
frontend/.env.development
Normal file
@ -0,0 +1 @@
|
||||
VITE_API_BASE_URL=http://localhost:8000/api
|
||||
1
frontend/.env.production
Normal file
1
frontend/.env.production
Normal file
@ -0,0 +1 @@
|
||||
VITE_API_BASE_URL=https://airlabs-manage-api.airlabs.art/api
|
||||
@ -2,15 +2,6 @@ server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# API 代理到后端服务(K8s 内部通信)
|
||||
location /api {
|
||||
proxy_pass http://airlabs-manage-backend:8000;
|
||||
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;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus'
|
||||
import router from '../router'
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
|
||||
timeout: 30000,
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user