This commit is contained in:
2026-03-19 16:36:41 +07:00
parent 1999395f3c
commit 7eddfb28b0
5 changed files with 14 additions and 4 deletions

View File

@@ -5,6 +5,15 @@ server {
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://backend:4000/api/;
proxy_http_version 1.1;
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 / {
try_files $uri $uri/ /index.html;
}

View File

@@ -1,4 +1,4 @@
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "http://localhost:4000/api";
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "/api";
async function request(path, options = {}) {
const response = await fetch(`${API_BASE_URL}${path}`, {