🐛 Fix images proxy, round 2 questions, media modal close

This commit is contained in:
Cosmo
2026-03-21 06:12:31 +00:00
parent c3b8415725
commit c5e1344610
2 changed files with 6 additions and 5 deletions

View File

@@ -29,14 +29,14 @@ server {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
} }
# Проксирование медиа (изображения, аудио, видео) # Проксирование медиа к серверу (prefix locations приоритетнее regex)
location /images/ { location ^~ /images/ {
proxy_pass http://svoya-igra-server:3001; proxy_pass http://svoya-igra-server:3001;
} }
location /audio/ { location ^~ /audio/ {
proxy_pass http://svoya-igra-server:3001; proxy_pass http://svoya-igra-server:3001;
} }
location /video/ { location ^~ /video/ {
proxy_pass http://svoya-igra-server:3001; proxy_pass http://svoya-igra-server:3001;
} }
@@ -49,6 +49,7 @@ server {
add_header Cache-Control "no-cache, no-store, must-revalidate"; add_header Cache-Control "no-cache, no-store, must-revalidate";
} }
# Кеширование статики клиента
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y; expires 1y;
add_header Cache-Control "public, immutable"; add_header Cache-Control "public, immutable";

View File

@@ -70,7 +70,7 @@ function Game() {
}) })
socket.on('question-selected', ({ category, points, questionIndex, timer }) => { 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 const questionData = questionIndex !== undefined
? categoryData?.questions[questionIndex] ? categoryData?.questions[questionIndex]
: categoryData?.questions.find(q => q.points === points) : categoryData?.questions.find(q => q.points === points)