feat: core func lab7

This commit is contained in:
Enterxx2
2026-11-24 14:04:04 +03:00
parent 4829fc7b4e
commit 411ca73aa0
83 changed files with 2883 additions and 523 deletions
+11 -1
View File
@@ -1,15 +1,25 @@
# Ошибки, созданные самим балансировщиком, — в формате ошибок контракта.
# Ответы реплик (включая их 503) проходят без изменений: proxy_intercept_errors off.
# X-Instance-Id здесь нет: ответ создан LB, а не API-репликой.
# Для ответов балансировщика используется идентичность nginx.
location @unavailable {
default_type application/json;
add_header X-Request-Id $request_id always;
add_header X-Instance-Id nginx always;
return 503 '{"error":{"code":"unavailable","message":"Нет доступной API-реплики","request_id":"$request_id"}}';
}
location @too_large {
default_type application/json;
add_header X-Request-Id $request_id always;
add_header X-Instance-Id nginx always;
return 413 '{"error":{"code":"payload_too_large","message":"Тело запроса слишком большое","request_id":"$request_id"}}';
}
location @rate_limited {
default_type application/json;
add_header X-Request-Id $request_id always;
add_header X-Instance-Id nginx always;
add_header Retry-After 1 always;
return 429 '{"error":{"code":"rate_limited","message":"Повторите запрос позднее","request_id":"$request_id"}}';
}