如何阻止通过 IP 地址访问 beanstalk Web 应用程序 [英] How to block accessing the beanstalk web app via ip address

查看:26
本文介绍了如何阻止通过 IP 地址访问 beanstalk Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 aws beanstalk 环境中部署了我的 Web 应用程序并添加了一个托管区域,然后添加了 SSL 证书.因此,现在可以通过安全域名访问该网站.但是我发现通过输入IP地址也可以访问相同的内容.我不希望通过 IP 地址访问我的网站.我怎样才能阻止这个?我还注意到这个 ip 地址不是我的应用程序所在的 EC2 实例的 ip 地址.任何帮助将不胜感激.

I have deployed my web app in aws beanstalk environment and added a hosted zone and then added SSL cert. So now the website can be accessed through a secure domain name. But I found the same can also be accessed via entering an ip address. I don't want my web site being accessed through ip address. How can I block this? Also I noticed this ip address is not the ip address of EC2 instance in which my app lies. Any help would be greatly appreciated.

推荐答案

我也注意到这个 IP 地址不是 EC2 实例的 IP 地址其中 my 适用.任何帮助将不胜感激

Also I noticed this IP address is not the IP address of EC2 instance in which my applies. Any help would be greatly appreciated

似乎该 IP 地址属于负载均衡器.一种方法是在负载均衡器中设置基于主机的路由,只有特定的 host 将被提供,例如 api.example.com 并在主机没有时发送修复响应匹配.

Seems like that IP address belongs Load balancer. One way is to Set host-based routing in the load balancer, only particularly host will be served for example api.example.com and send fix response if the host does not match.

请求其他部分可以带有修复响应,因此只能提供带有 api.example.com 的请求.

request otherwise section can be with fix response, so only request with api.example.com can be served.

这篇关于如何阻止通过 IP 地址访问 beanstalk Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆