Last Updated: February 25, 2016
·
379
· gregmolnar

Require www on Nginx

Without hardcoding the actual domain:

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