Most people type in the browser bar: mysite.com
and not https://mysite.com
.
Alot of developers including myself have something like this in their Nginx config file which means that this mysite.com
request causes a redirect
to the https://
site:
server {
listen 80;
server_name mysite.com;
return 301 https://$server_name$request_uri;
}
Google pagespeed team recently said [ref] these redirects are terrible for performance particularly on mobile because the redirect
causes the request to go back through the mobile carrier network.
My question is is there any other way to write the nginx.conf such that people typing in the server_name
don't experience this http://
to https://
redirect penalty?