I am setting up a relatively simple microservice API application using AWS and Spring Boot. My configuration is:
My expectation is that an incoming HTTP GET request to https:\mydomain.com\health will hit my NLB, the TLS:443 listener decrypts and forwards to my ec2 instance according to the port configured (8080). My ec2 instance should thus not be set up for HTTPS (no cert) since it receives decrypted traffic.
The actual result is that all requests to mydomain.com seem to hit my EC2 instance at port 443, regardless of the above configuration. They are "getting through" to the instance since I get [machine IP]:443 ECONNREFUSED errors. Am I wrong to expect the traffic on port 8080? Do I have something misconfigured? Any guidance on what I might be missing would be greatly appreciated!
Sigh.... the curse of finding the solution moments after writing a post about it.
My issue arose from a bad A record in Route 53 that was forwarding directly to the EC2 instance instead of the load balancer. I deleted the bad record and created a new record that points to my NLB via quick create. Sure enough, now everything works.