Last Updated: February 25, 2016
·
396
· gregmolnar

Require www on Nginx

Without hardcoding the actual domain:

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