Rajeesh Thayyullathil
Rajeesh Thayyullathil

Reputation: 11

How to block accessing the beanstalk web app via ip address

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.

Upvotes: 0

Views: 617

Answers (1)

Adiii
Adiii

Reputation: 60016

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

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.

enter image description here

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

enter image description here

Upvotes: 1

Related Questions