Redirect From non-WWW to WWW

My web server is Ngnix.
I found it and its work.
Code:
if ($host ~* ^domain.com$) {
    return 301 $scheme://www.domain.com$request_uri;
}
 
Back
Top