Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
进行健康检查时,我需要将健康检查设置为路径 /server_name/health
但需要使用api key(标题)访问
api key
如何实施这种类型的健康检查?
不幸的是,没有代理就没有直接的方法可以做到这一点。ALB 仅支持GET健康检查。
GET
一种解决方法是将状态代码设置为 403(或任何在身份验证失败时从您的服务返回的值)而不是 200。这通常有效,因为如果服务以预期的身份验证失败代码(例如 403)响应,您可以假设应用程序正在运行.
运行状况检查不支持传递自定义标头。您仅限于以下情况:
作为解决方案的替代方案,您是否可以使用带有 API 密钥的查询字符串而不是标题?