I'm currently using Amazon Route53 to manage our DNS and have run into a snag.
Our static content is served from AWS S3, however, S3 doesn't support HTTPS with CNAME's. To get around Cross Domain issues, our static content is served via CNAME.
So, I'd like to continue to serve HTTP content via S3, and serve our HTTPS content through our own webserver.
However I'm not sure how I can route HTTP traffic to one domain (s3), and route HTTPS to another domain (a webserver).
DNS is only concerned with resolving hostnames to IP, and is not concerned with protocol or port numbers -- this means to directly answer your question; No: you cannot use it to route
https://example.com
to one IP andhttp://example.com
to another.There are a couple common ways around this:
http://
andhttps://example.com
, such as nginx. This proxy can look at the protocol and even request path, and route to other server(s) appropriately.http://static.example.com
andhttps://example.com
. DNS would resolvestatic.example.com
to S3, andexample.com
to your other app server.If your app servers are separated by slow network connections (sounds like they are) then IMHO the only way to go is a DNS-based solution.