관련 URL 1 http://stackoverflow.com/questions/79470...-to-no-www 
관련 URL 2 http://pasted.co/8fa87c05 
관련 URL 3 https://www.digitalocean.com/community/t...n-centos-7 
관련 URL 4  
소스코드 server {
listen 80;
server_name mysite.com;
return 301 http://www.mysite.com$request_uri;
}

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /var/www/html;
index index.php index.html index.htm;

server_name www.mysite.com;

location / {
try_files $uri $uri/ =404;

}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

1) www 붙이고 접속했을 때 www 없이 접속하는 법

server{
    if ($http_host = "www.eond.com") {
        rewrite ^ http://eond.com$request_uri permanent;
    }
}

2) www 없이 접속했을 때 무조건 www 붙이기

 if ($http_host != "www.example.com") {
                 rewrite ^ http://example.com$request_uri permanent;
       }