当前位置:优学网  >  在线题库

从API网关访问ALB内部服务器错误

发表时间:2022-07-15 00:39:29 阅读:98

我尝试将ALB集成到API网关.

const ecs_url = new apigateway.HttpIntegration("https://" + props!.alb.loadBalancerDnsName);

const api = new apigateway.RestApi(this, `api-${targetEnv}-for-ecs`, { cloudWatchRole: true });

api.root.addMethod('GET',ecs_url);

这使得API像这样,

https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/prod

然而,当访问这里时,它给了我一个错误

{"message": "Internal server error"}

cloudwatch中有这样的错误.

Execution failed due to configuration error: Host name 'ss-stag-lb-640244442.us-west-2.elb.amazonaws.com' does not match the certificate subject provided by the peer (CN=*.mydomain.com)

*.mydomain.com设置为该ALB dns,但当我通过浏览器直接访问loadBalancerDnsName例如(ss-stag-lb-640233333.us-west-2.elb.amazonaws.com)时,它会给出正确的响应.

我有两个问题.

1、我可以绕过证书检查吗? 2、有没有办法给ss-stag-lb-640233333认证.us-west-2.elb.amazonaws.com

🎖️ 优质答案
相关问题