I want to create a web server that does redirects HTTP to HTTPS. What is the simplest method to do this but also secure? Should the DNS handle this? (For example, Route53)
I used to do this with my app built from Node/Express but now that I am using a compiled language, I want to be able to do this by hand instead of relying on a framework.
If I configure DNS to redirect http to https, is that more secure than the server program? (My thinking here is that since the server never sent a response, the potential attacker's req never arrived and thus has no message to receive.)
Would it matter which DNS does this? (For example, if you purchased your domain from domain.com but your server is on AWS linked through Route53?)