This is the MLG configuration, it folds inwards, with all of it mounted aft of the wing rear spar:
the fore-aft beam shown above is just outboard of the trunnion, which mounts in bearings in the rear spar and aux spar/fitting (grey in image below).
this is the wing box internal structure from...