modified: main_dc/nginx/nginx-ssl.conf
set new settings for valitovgaziz.ru site api/analytitcs
This commit is contained in:
@@ -77,6 +77,7 @@ server {
|
|||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Проксирование для аналитики
|
||||||
location /api/analytics {
|
location /api/analytics {
|
||||||
proxy_pass http://analytics:3000;
|
proxy_pass http://analytics:3000;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
@@ -86,12 +87,37 @@ server {
|
|||||||
|
|
||||||
# CORS headers
|
# CORS headers
|
||||||
add_header Access-Control-Allow-Origin "*" always;
|
add_header Access-Control-Allow-Origin "*" always;
|
||||||
add_header Access-Control-Allow-Methods "POST, OPTIONS" always;
|
add_header Access-Control-Allow-Methods "POST, GET, OPTIONS" always;
|
||||||
add_header Access-Control-Allow-Headers "Content-Type" 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) {
|
if ($request_method = OPTIONS) {
|
||||||
return 204;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user