feat(nest-front): add API_URL proxy and VITE_API_URL support for split deployment
- nginx.conf: proxy /api/ to ${API_URL} (injected at container start via envsubst)
- Dockerfile: accept VITE_API_URL build arg; use envsubst CMD to hydrate nginx template
- src/utils/api.ts: export API_BASE using VITE_API_URL or fallback to /api
Enables nest-front to run on Coolify while nest-backend runs on Portainer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,13 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass ${API_URL}/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 / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user