"Bei" is Mandarin for north. "Nan" means south. So "Nanjing" means Southern Capital. As the name suggests, Nanjing was the seat of various governments throughout Chinese history.
Besides Nanjing and Xian, which are more popular, there are also Kaifeng and Luoyang. They both were the capital of various Chinese states.
Xi'an was the capital of the Tang Dynasty, as they were heavily oriented towards Central Asia for trade and mercenaries.