Require www on Nginx
Without hardcoding the actual domain:
if ($host !~* ^www.(.)){
rewrite ^/(.) http://www.$host/$1;
}
Written by gregmolnar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nginx
Authors
reiaguilera
279.4K
jamesdullaghan
90.14K
Related Tags
#nginx
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#