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.8K

jamesdullaghan
90.26K
Related Tags
#nginx
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#