What does ‘up the river’ mean?

up the river

( ap ) In prison or jail. They sent him up the river for 20 years for his part in the heist.