13.12.25 - начало разработки фронта

This commit is contained in:
2025-12-13 23:30:05 +03:00
commit be9fdad7d0
17 changed files with 787 additions and 0 deletions

28
nginx.conf Normal file
View File

@@ -0,0 +1,28 @@
server {
listen 80;
server_name localhost;
# Сжатие (gzip) для скорости
gzip on;
gzip_types text/plain application/javascript text/css application/json;
# Корневая папка со сборкой
root /usr/share/nginx/html;
index index.html;
# 1. Раздача фронтенда (React Router support)
location / {
try_files $uri $uri/ /index.html;
}
# 2. Проксирование API на бэкенд-контейнер
# http://server:8080 - это имя сервиса из docker-compose и его внутренний порт
location /api/ {
proxy_pass http://server:8080/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;
}
}