HTTPS enforced on every pageAutomated
All pages of the app must be served over HTTPS.
Every page, including marketing pages on the same host, should only be reachable over HTTPS. Plain HTTP should redirect permanently.
Check it yourself
curl -sI http://app.example.com | grep -iE "^(HTTP|location)" # expect: HTTP/1.1 301 … and location: https://…
Fix it
nginx
server {
listen 80;
server_name app.example.com;
return 301 https://$host$request_uri;
}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;Express
app.set('trust proxy', 1);
app.use((req, res, next) =>
req.secure ? next() : res.redirect(301, `https://${req.headers.host}${req.url}`));