I\'m trying to reroute http (80) to https (443) in my express app. I\'m using some middle ware to do this. If i go to my https://my-example-
http (80)
https (443)
https://my-example-
You can achieve redirection from http to https
if(req.headers["x-forwarded-proto"] == "http") { res.redirect(301, "https://" + req.host+req.url); next(); }