Shangyu District (Chinese: 上虞区; pinyin: Shàngyú) is a district of the prefecture-level city of Shaoxing in the northeast of Zhejiang province, China. At the 2010 census, its population in the built-up (or metro) area was 779,412, up from 722,523 in the 2000 census. Shangyu is roughly fifty kilometers from north to south and about thirty kilometers from east to west. It makes up about one-fourth of the area of Shaoxing prefecture. Shangyu District is not part of the Hangzhou-Shaoxing built-up area as some countryside still prevent the city from being conurbated until now.
Shangyu's urban center, Baiguan, is located where the Cao'e River flows out of the hilly area that makes up more than half of the county, into flat alluvial land bordering Hangzhou Bay. This river, and the Cao E Temple (曹娥庙) next to it, are named after a fourteen-year-old girl who became famous in 143 AD for her filial devotion. She died in the river trying to retrieve the body of her father (Cao Xu) who drowned while officiating at a ceremony in honor of Wu Zixu who himself was famous for his filial piety.
Baiguan is about 28 kilometers east of Shaoxing's urban center. The railroad from Hangzhou to Ningbo passes through Baiguan, and the new superhighway between Hangzhou and Ningbo skirts Baiguan. Within Shangyu, just northwest of Baiguan, the Hangzhou-Ningbo highway (mostly east-west) intersects with a superhighway that goes south to the seacoast and then down the coast, through Wenzhou and Fuzhou, all the way to Guangzhou.
In the name "Baiguan" (百官) “bai” means “hundred” and “guan” means an imperial civil service official. The city came to be called this when it became famous for producing many scholars who became officials by passing the imperial civil service examination.