NGINX Redirect WWW to non WWW

server {
    server_name www.example.com;
    return 301 $scheme://example.com$request_uri;
}

https://www.digitalocean.com/community/tutorials/how-to-redirect-www-to-non-www-with-nginx-on-centos-7

Advertisements