From d690546f0edd3225e57a3f92e704492d3044e4f2 Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 27 May 2026 15:25:42 +0500 Subject: [PATCH] fix: restore api proxy for Coolify, remove ports, use expose --- docker-compose.yml | 8 ++++---- frontend/nginx.conf | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7b2dd7a..0d44dad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,8 @@ services: backend: build: ./backend - ports: - - "${BACKEND_PORT:-3001}:3001" + expose: + - 3001 env_file: - .env environment: @@ -14,8 +14,8 @@ services: context: ./frontend args: - VITE_API_URL=/api - ports: - - "${FRONTEND_PORT:-8080}:80" + expose: + - 80 depends_on: - backend restart: unless-stopped diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 2d96d15..e6d92d7 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -7,4 +7,13 @@ server { location / { try_files $uri $uri/ /index.html; } + + location /api/ { + proxy_pass http://backend:3001/api/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } }