Two approaches:
1) The wrong but easy way:
Code:
server {
listen ...
server_name example.com www.example.com ...;
# Redirect www.example.com to example.com
if ($host ~* (www)\.(.*)) {
set $host_without_www $2;
rewrite ^(.*)$ $scheme://$host_without_www$1 permanent;
}
2) The more correct way:
Code:
server {
listen ...
server_name example.com ...;
# All the existing configuration, but without www.example.com in the server_name
}
server {
listen ...
server_name www.example.com;
location / {
rewrite ^/(.*) $scheme://example.com/$1 permanent;
}
}
The node balancer does not make a difference here.
_________________
Code:
/* TODO: need to add signature to posts */