diff --git a/admin-panel/nginx.conf b/admin-panel/nginx.conf index 8c9a4d7..428ea70 100644 --- a/admin-panel/nginx.conf +++ b/admin-panel/nginx.conf @@ -23,12 +23,16 @@ server { application/javascript application/json application/xml image/svg+xml; + # Backend proxy shared settings (used by /api/ and /categories/) # API proxy to backend service # All requests to /api/* are proxied to the backend container location /api/ { proxy_pass http://backend:8001; proxy_http_version 1.1; + # Internal API key for backend authentication + proxy_set_header X-API-Key changeme; + # Preserve original request information proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -45,6 +49,22 @@ server { proxy_request_buffering off; } + # Categories API proxy (used by CategoryManagement) + location /categories/ { + proxy_pass http://backend:8001; + proxy_http_version 1.1; + + proxy_set_header X-API-Key changeme; + 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; + + proxy_connect_timeout 60s; + proxy_send_timeout 120s; + proxy_read_timeout 120s; + } + # Static assets caching (JS, CSS, images, fonts) location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 1y; diff --git a/admin-panel/src/config/api.js b/admin-panel/src/config/api.js index 4920ec8..bb5601e 100644 --- a/admin-panel/src/config/api.js +++ b/admin-panel/src/config/api.js @@ -4,7 +4,7 @@ */ // API Base URL from environment or default -export const API_URL = import.meta.env.VITE_API_URL ?? 'http://127.0.0.1:8001' +export const API_URL = import.meta.env.VITE_API_URL ?? '' // Timeout configurations (in milliseconds) export const TIMEOUT_CONFIG = {