first of all sorry for my ignorance but there is a concept which is not very clear for me in the AWS ELB word.
I have a frontend site deployed on cloudfront and an API running into an EC2 instance.
What I want to archive is to avoid having 2 domains to serve the same data.
For example I want to access through my site using https://example.com/post and you will see the site itself (HTML from cloudfront).
But if you are trying to access to https://example.com/post passing the HTTP/HEADER Accept: application/json you would be able to see the json content from the API server itself (EC2 Instance).
Is that possible using an ELB ? or do I have to make some trick into the EC2 instance like having an nginx seted up as a proxy and serve the cloudfront content if no header is present?
Thanks in advance.