Johnson in Acoustic and auditory phonetics addresses this; the nomogram here on slide 7 graphs the problem. essentially, the answer is "it's complicated". You compute the resonance of each tube based on their length. Whether the first formant is "due to" the back cavity or the front cavity depends on which is longer (and thus which resonance is lower). When the back cavity is short and the front cavity is long (meaning: the vowel is more back), the front cavity has a lower resonance frequency than the back one, and the length of the front cavity "causes" F1. When the back cavity is long and the front cavity is short, the back cavity "causes" F2. The back cavity is usually at least 6 cm long whereas the front cavity can be 3-4 cm long. On the nomogram, the light grey descending line graphs the contribution of the back cavity and the dark blue ascending line graphs the contribution of the front cavity. But as the slides also indicate, they basically have two models of formant computation, based on whether there is a pharyngeal constriction (the back tube is very narrow, the model is "both tubes closed at one end") versus a short constriction in the mouth (the model is "back=tube closed at both ends, front=tube closed at one end).