我有一个HTTP负载均衡器设置,如下所示。内容将根据URL路由到后端存储桶或实例组。
当我尝试使用负载均衡IP访问API时,出现错误Status Code: 401 Unauthorized
。
以下是该特定请求的Stackdriver日志记录快照。
http://3xxxxxx5/api/GetAccountTransaction?key=AIzaSyC3xxxxxxMHNAxKM
1xxxxxx06 - "POST http://3xxxxxx5/api/GetAccountTransaction?key=AIzaSyC3xxxxxxMHNAxKM" 401 494 "http://3xxxxxx5/" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
Expand all | Collapse all {
httpRequest: {
referer: "http://3xxxxxx5/"
remoteIp: "1xxxxxx06"
requestMethod: "POST"
requestSize: "559"
requestUrl: "http://3xxxxxx5/api/GetAccountTransaction?key=AIzaSyC3xxxxxxMHNAxKM"
responseSize: "494"
status: 401
userAgent: "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
}
insertId: "efo39lf8k5sux"
jsonPayload: {
@type: "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry"
statusDetails: "response_sent_by_backend"
}
logName: "projects/sixxxxxx4204/logs/requests"
receiveTimestamp: "2018-03-30T12:09:37.539673973Z"
resource: {
labels: {
backend_service_name: ""
forwarding_rule_name: "prepay-ip-address"
project_id: "sixxxxxx4204"
target_proxy_name: "prepay-service-target-proxy"
u
rl_map_name: "prepay-service"
zone: "global"
}
type: "http_load_balancer"
}
severity: "WARNING"
spanId: "5da2dc551e28dbcc"
timestamp: "2018-03-30T12:09:36.491864533Z"
trace: "projects/sixxxxxx4204/traces/52617f14af59859ee38e759f605bc545"
}
但是,当我使用相同的请求但使用VM实例的外部IP时,它可以工作。
负载均衡器的此错误引用了什么身份验证?