new web ract
This commit is contained in:
32
web-react/nginx.conf
Normal file
32
web-react/nginx.conf
Normal file
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user