modified: main_dc/nginx/nginx-ssl.conf

set new settings for valitovgaziz.ru site api/analytitcs
This commit is contained in:
2025-11-11 03:47:03 +05:00
parent 5d2157fe06
commit 9fe2e24189
+28 -2
View File
@@ -77,6 +77,7 @@ server {
try_files $uri $uri/ /index.html;
}
# Проксирование для аналитики
location /api/analytics {
proxy_pass http://analytics:3000;
proxy_set_header Host $host;
@@ -86,12 +87,37 @@ server {
# CORS headers
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Allow-Methods "POST, OPTIONS" always;
add_header Access-Control-Allow-Headers "Content-Type" always;
add_header Access-Control-Allow-Methods "POST, GET, OPTIONS" always;
add_header Access-Control-Allow-Headers "Content-Type, Authorization" always;
add_header Access-Control-Allow-Credentials "true" always;
# Handle preflight requests
if ($request_method = OPTIONS) {
return 204;
}
# Таймауты
proxy_connect_timeout 30s;
proxy_send_timeout 30s;
proxy_read_timeout 30s;
}
# Health check для аналитики
location /api/analytics/health {
proxy_pass http://analytics:3000/health;
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;
}
# Статистика аналитики
location /api/analytics/stats {
proxy_pass http://analytics:3000/api/stats;
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;
}
}