Files
AutoMarket/frontend/nginx.conf
2026-05-15 20:19:47 +03:00

32 lines
929 B
Nginx Configuration File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Все запросы к /api/ проксируем на Flask бэкенд
location /api/ {
proxy_pass http://backend:5000/api/;
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_read_timeout 60s;
}
# Socket.IO проксируем на бэкенд
location /socket.io/ {
proxy_pass http://backend:5000/socket.io/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 60s;
}
# Все остальные запросы — статические файлы
location / {
try_files $uri $uri/ /index.html;
}
}