map $http_host $pm2 {
    someprojectone.build.local.wpstudio.ru pm2-someprojectone;
    someprojecttwo.build.local.wpstudio.ru pm2-someprojecttwo;
}

server {
    listen 80;
    server_name
        someprojectone.build.local.wpstudio.ru
        someprojecttwo.build.local.wpstudio.ru
    ;
    location / {
        resolver 127.0.0.11;
        proxy_pass http://$pm2:3000;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_buffer_size 16k;
        proxy_buffers 8 16k;
        proxy_busy_buffers_size 32k;
    }
}
