From 7438e2b57a97309960bd395310ad9f04ce767fe9 Mon Sep 17 00:00:00 2001 From: RM Date: Thu, 15 Oct 2026 02:02:05 +0300 Subject: [PATCH] add missed file --- frontend/nginx.conf.template | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 frontend/nginx.conf.template diff --git a/frontend/nginx.conf.template b/frontend/nginx.conf.template new file mode 100644 index 0000000..dc6be46 --- /dev/null +++ b/frontend/nginx.conf.template @@ -0,0 +1,30 @@ +server { + listen 80; + + # API бэкенда. Хост задается переменной BACKEND_HOST: + # в нашем docker-compose.yaml это client-backend (дефолт в Dockerfile), + # в кастомных файлах переопределите через environment. + location /api/ { + proxy_pass http://${BACKEND_HOST}:8181; + 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_set_header X-Forwarded-Proto $scheme; + } + + # Swagger UI бэкенда (удобно на первое время, потом можно закрыть) + location /swagger-ui/ { + proxy_pass http://${BACKEND_HOST}:8181; + proxy_set_header Host $host; + } + location /v3/api-docs { + proxy_pass http://${BACKEND_HOST}:8181; + proxy_set_header Host $host; + } + + # Статика React SPA + location / { + root /usr/share/nginx/html; + try_files $uri /index.html; + } +}