apt-get -y update
apt-get -y install nginx;
echo "<center><h2>Welcome to $HOSTNAME</h2></center>" | sudo tee /usr/share/nginx/www/index.html;
service nginx start
eg.:
gcloud compute instances create my-first-instance --image debian-7 --metadata startup-script='apt-get -y update; apt-get -y install nginx; echo "<center><h2>Welcome to $HOSTNAME</h2></center>" | sudo tee /usr/share/nginx/www/index.html; service nginx start'