1. 方法①(推荐):新增一个server

server {
    listen 80;
        server_name 139car.cn;
        return 301 $scheme://www.139car.cn$request_uri;
}

2. 方法②(在server中间加入):

server
{
    listen 80;
    server_name www.139car.cn 139car.cn;
    if ($host = '139car.cn' ) {    
        rewrite ^/(.*)$ http://www.139car.cn/$1 permanent;
    }
    index  index.html index.htm default.php default.htm default.html index.php;
    root /www/wwwroot/www.139car.cn;
.........
我 秦始皇 打钱