问题描述
我在7070端口(非SSL)上创建了ALB侦听器443和目标组实例
Hi i created ALB listener 443 and target group instance on 7070 port (not-ssl)
我可以毫无问题地访问instanceip:7070,但是 https://elb-dns-name 无法访问..实例运行状况检查也失败,并显示302代码
I can access instanceip:7070 without problem , but with https://elb-dns-name not able to access.. instance health check also failed with 302 code
ALB侦听器端口https和实例是http协议
ALB listener port https and instance is http protocol ,
当我使用 https://dns-name 浏览时,它将重定向到 http://elb-dns-name
when i browse with https://dns-name it redirecting to http://elb-dns-name
推荐答案
在执行URL重定向时,您将获得302,任何ELB运行状况检查都将查找成功代码200,以使运行状况检查通过.在ALB中,可以在ELB控制台的运行状况检查下对其进行配置.
you get 302 when performing URL redirection, any ELB Health check will look for success code 200 for the health check to pass. In ALB, this can be configured under health check in the ELB console.
使用控制台修改目标组的运行状况检查设置
To modify the health check settings of a target group using the console
- 通过 https://console.aws.amazon.com/ec2/.
- 在导航窗格上的负载平衡"下,选择目标组".选择目标组.
- 在运行状况检查"选项卡上,选择编辑".
- 在编辑目标组"页面上,将设置
Success Codes
修改为302或根据需要,然后选择保存".
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
- On the navigation pane, under LOAD BALANCING, choose Target Groups.Select the target group.
- On the Health checks tab, choose Edit.
- On the Edit target group page, modify the setting
Success Codes
to 302 or as needed, and then choose Save.
这篇关于AWS-Elb运行状况检查失败,代码为302的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!