From c5e134461074e460298fb4c8f65ed3ec10b9f9f6 Mon Sep 17 00:00:00 2001 From: Cosmo Date: Sat, 21 Mar 2026 06:12:31 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20images=20proxy,=20round=20?= =?UTF-8?q?2=20questions,=20media=20modal=20close?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/nginx.conf | 9 +++++---- client/src/pages/Game.jsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/nginx.conf b/client/nginx.conf index 6c5ec88..21b4d5a 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -29,14 +29,14 @@ server { proxy_set_header X-Real-IP $remote_addr; } - # Проксирование медиа (изображения, аудио, видео) - location /images/ { + # Проксирование медиа к серверу (prefix locations приоритетнее regex) + location ^~ /images/ { proxy_pass http://svoya-igra-server:3001; } - location /audio/ { + location ^~ /audio/ { proxy_pass http://svoya-igra-server:3001; } - location /video/ { + location ^~ /video/ { proxy_pass http://svoya-igra-server:3001; } @@ -49,6 +49,7 @@ server { add_header Cache-Control "no-cache, no-store, must-revalidate"; } + # Кеширование статики клиента location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, immutable"; diff --git a/client/src/pages/Game.jsx b/client/src/pages/Game.jsx index 549dea4..e64981d 100644 --- a/client/src/pages/Game.jsx +++ b/client/src/pages/Game.jsx @@ -70,7 +70,7 @@ function Game() { }) socket.on('question-selected', ({ category, points, questionIndex, timer }) => { - const categoryData = game?.selectedCategories?.find(cat => cat.name === category) + const categoryData = questions?.find(cat => cat.name === category) const questionData = questionIndex !== undefined ? categoryData?.questions[questionIndex] : categoryData?.questions.find(q => q.points === points)