docker composed
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# Статика фронтенда
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html; # Для SPA роутинга (если понадобится)
|
||||
}
|
||||
|
||||
# Проксирование API на бэкенд
|
||||
location /api/ {
|
||||
proxy_pass http://backend:8000/;
|
||||
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;
|
||||
|
||||
# Важно: убираем префикс /api, так как бэк ожидает пути вроде /auth/login
|
||||
rewrite ^/api/(.*)$ /$1 break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user