Files
goSSS-front/nginx.conf

28 lines
904 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 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;
}
}