If you have used AWS Elastic Load Balancers before, you might have come across this note while creating a new ELB:
Because the set of IP addresses associated with a LoadBalancer can change over time, you should never create an “A” record with any specific IP address. If you want to use a friendly DNS name for your load balancer instead of the name generated by the Elastic Load Balancing service, you should create a CNAME record for the LoadBalancer DNS name, or use Amazon Route 53 to create a hosted zone. For more information, see Using Domain Names With Elastic Load Balancing.
While CNAMEs would be suitable for most use cases, there are certain situations where CNAMEs do not fit business requirements. Like,
- When the DNS provider does not allow CNAMEs for the naked domain. This is not an issue if you are using AWS Route53
- Where the client’s IT policy requires you to provide the A records for whitelisting purposes
- Where the application does not handle CNAMEs which resolve to multiple IPs (like Varnish)
- Where the application does not expire the TTLs correctly. Since the ELB IPs can change over a period of time, the application can stop working when the IP changes
In situation like above, you can run a various load balancer solutions thats available in the AWS Marketplace. Citrix Netscaler VPX Edition which runs on AWS Cloud is a very popular solution. However, these solutions require to run inside a VPC.
Nginx Plus, A commercial product which is available from the AWS Marketplace is a good fit for the following use case:
- Runs in Classic EC2 using a 2 instance setup
- Can do HTTP and HTTPs content serving along with reverse proxy features
In the next blog article, I’ll describe the setup and configuration of a 2 node Nginx Cluster on AWS Classic EC2 environment.