Добавлена подсветка воспроизводимой песни

This commit is contained in:
FrigaT
2026-05-22 00:07:26 +03:00
parent 9139d8ecfe
commit efe1c3c2dd
23 changed files with 362 additions and 57 deletions

View File

@@ -5,7 +5,7 @@ events {
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Не раскрывайть версию Nginx в ответах.
server_tokens off;
@@ -18,6 +18,29 @@ http {
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/wasm application/json;
# Бэкенд API (для OG-тегов)
upstream api_backend {
server playlistshared_api:80;
}
# Определяем, является ли запрос ботом-краулером
map $http_user_agent $is_crawler {
default 0;
~*Slackbot 1;
~*facebookexternalhit 1;
~*Twitterbot 1;
~*TelegramBot 1;
~*WhatsApp 1;
~*LinkedInBot 1;
~*vkShare 1;
~*Pinterest 1;
~*Googlebot 1;
~*YandexBot 1;
~*Discordbot 1;
~*Applebot 1;
~*DuckDuckBot 1;
}
server {
listen 80;
server_name localhost;
@@ -54,6 +77,18 @@ http {
try_files $uri =404;
}
# OG-теги: краулеры получают HTML с meta-тегами от API
location ~ ^/shared/(.+)$ {
if ($is_crawler) {
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;
proxy_set_header Host $host;
proxy_pass http://api_backend;
}
try_files $uri $uri/ /index.html?$args;
}
# Основной SPA fallback: все неизвестные пути отдаём через index.html
location / {
try_files $uri $uri/ /index.html?$args;