nginx www to non www
redirect url with www to non www. edit /etc/nginx/nginx.conf or /etc/nginx/sites-enabled/default
if ($host ~* www\.(.*)){
set $host_without_www $1;
rewrite ^(.*)$ http://$host_without_www$1 permanent;
}
redirect url with www to non www. edit /etc/nginx/nginx.conf or /etc/nginx/sites-enabled/default
if ($host ~* www\.(.*)){
set $host_without_www $1;
rewrite ^(.*)$ http://$host_without_www$1 permanent;
}