[英]Why is my aws elastic beanstalk listener path-based forward rule not working?
I have 2 "forward to" rules on an HTTP port 80 listener (see image).我在 HTTP 端口 80 侦听器上有 2 个“转发到”规则(见图)。 If a browser requests http://{domain}/health or http://{domain}/health/, these rules are supposed to forward traffic to the target group at the current port.
如果浏览器请求 http://{domain}/health 或 http://{domain}/health/,则这些规则应该将流量转发到当前端口的目标组。
If they don't, traffic should be redirected to the HTTPS port 443.如果没有,则应将流量重定向到 HTTPS 端口 443。
Unfortunately, requesting /health/ or /health still sends me down the https 443 port.不幸的是,请求 /health/ 或 /health 仍然会将我发送到 https 443 端口。 This is causing issues for the ELB health checker (described more in this guide https://medium.com/@Pibastte/how-to-setup-http-to-https-redirection-for-a-django-application-on-aws-elastic-beanstalk-and-have-de44cf05565 ).
这会导致 ELB 运行状况检查器出现问题(本指南https://medium.com/@Pibastte/how-to-setup-http-to-https-redirection-for-a-django-application-on-中有更多描述aws-elastic-beanstalk-and-have-de44cf05565 )。 My rules are exactly the same as in that guide*.
我的规则与该指南中的完全相同*。
So what's going on?发生什么了? Any help is appreciated:)
任何帮助表示赞赏:)
*Edit: Woop I just realized that I forgot to mention that I rigorously tried paths both with and without the asterisk at the beginning. *编辑:哎呀,我刚刚意识到我忘了提到我在开始时严格尝试了带星号和不带星号的路径。
Based on the comments.根据评论。
The listener rules are correct .监听器规则是正确的。 The rules were verified using:
使用以下方法验证规则:
curl -i http://{domain}/health/
which returned HTTP 200 , rather then HTTP 301 (redirection), as expected.正如预期的那样,它返回HTTP 200 ,而不是 HTTP 301 (重定向)。
It also should be noted, that browsers can force http
to https
redirection.还应该注意的是,浏览器可以强制
http
到https
重定向。 Thus its always better to check any HTTP requests using curl
.因此,使用
curl
检查任何 HTTP 请求总是更好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.