Redirecting a www based domain to a non-www based or naked domain is pretty easy - in the nginx conf file, you'll need something like this:
server {
listen 80;
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
server {
listen 80;
server_name example.com;
...rest of your conf
}
You might not want to do this though. Using naked domains is not always the best idea.
Comments
Post a Comment