Last Updated: February 25, 2016
·
399
· gregmolnar

Require www on Nginx

Without hardcoding the actual domain:

if ($host !~* ^www.(.)){
rewrite ^/(.
) http://www.$host/$1;
}