BackgroundDespite the knowledge that the soil–plant–microbiome nexus is shaped by interactions amongst its members, very little is known about how individual symbioses regulate this shaping. Even less is known about how the agriculturally important symbiosis of nitrogen-fixing rhizobia with legumes is impacted according to soil type, yet this knowledge is crucial if we are to harness or improve it. We asked how the plant, soil and microbiome are modulated by symbiosis between the model legumeMedicago truncatulaand different strains ofSinorhizobium melilotiorSinorhizobium medicaewhose nitrogen-fixing efficiency varies, in three distinct soil types that differ in nutrient fertility, to examine the role of the soil environment upon the plant–microbe interaction during nodulation.ResultsThe outcome of symbiosis results in installment of a potentially beneficial microbiome that leads to increased nutrient uptake that is not simply proportional to soil nutrient abundance. A number of soil edaphic factors including Zn and Mo, and not just the classical N/P/K nutrients, group with microbial community changes, and alterations in the microbiome can be seen across different soil fertility types. Root endosphere emerged as the plant microhabitat more affected by this rhizobial efficiency-driven community reshaping, manifested by the accumulation of members of the phylum Actinobacteria. The plant in turn plays an active role in regulating its root community, including sanctioning low nitrogen efficiency rhizobial strains, leading to nodule senescence in particular plant–soil–rhizobia strain combinations.ConclusionsThe microbiome–soil–rhizobial dynamic strongly influences plant nutrient uptake and growth, with the endosphere and rhizosphere shaped differentially according to plant–rhizobial interactions with strains that vary in nitrogen-fixing efficiency levels. These results open up the possibility to select inoculation partners best suited for plant, soil type and microbial community.Video AbstractSupplementary InformationThe online version contains supplementary material available at 10.1186/s40168-023-01592-0.