Lots of good advice in the thread already

, apart from the people saying play through the pain.
+1 on 1-2-4 fingering near the nut, but not everyone has problems with thumb opposite middle finger. I do this with no pain/cramping.
+1 on upright technique near the nut. I've got big hands and still prefer to use upright 1-2-4 on my Jags (Jazz-neck profiles, I believe).
I play upright primarily, bass guitar (34"-scale) at home and recently have been playing a borrowed UBass. Each has its own requirements for technique.
Adapt your technique, swap necks, do stretching exercises before and after playing, do whatever it takes to... Keep Playing!