33 lines
989 B
Nginx Configuration File
33 lines
989 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
|
|
# Главное React-приложение
|
|
location / {
|
|
root /usr/share/nginx/html/app;
|
|
try_files $uri /index.html;
|
|
}
|
|
|
|
# Редактор статей (отдельный React-билд)
|
|
location /editor/ {
|
|
root /usr/share/nginx/html;
|
|
try_files $uri /editor/index.html;
|
|
}
|
|
|
|
# Статические ассеты редактора (Vite base: '/editor-assets/')
|
|
location /editor-assets/ {
|
|
alias /usr/share/nginx/html/editor/;
|
|
}
|
|
|
|
# Проксируем API-запросы на FastAPI
|
|
location /api/ {
|
|
proxy_pass http://api:8000/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
# Отключаем буферизацию для быстрого ответа
|
|
proxy_buffering off;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
|
|
}
|