We have an application hosted on AWS elastic beanstalk, We are able to redirect from example.com to https://www.example.com successfully.
If my application has more load then auto scaling groups adds one more EC2 instance in back end to handle the load.
Let's say InstanceA is running and load got increased and InstanceB got added, When load gets normal auto scaling groups terminates one of the instance, currently in my application it is deleting old existing InstanceA, All our redirection rules are written on InstanceA so my application redirection fails when instance scales up.
Please help, Is there any option to hold my existing instance? or do we need to write same redirection rule for each instance which gets spin up?