Nginx rule to redirect non-www to www

You could add the above into the server block for port 443. No other changes are needed.