Why http www doesnt redirect to https?

So, I install https://site.com.
https://www - redirects
http:// - redirects
http://www - doesn’t redirect

How to solve that?

Read nginx docs.