there are a lot of factors ranging from edaphic to biotic that affect BNF, however you asked only about environmental ones, following are some really important of them, whose affect is readily visible are
1. light regime and photosynthetic efficiency, , upon which biological nitrogen fixation depends. This is demonstrated by diurnal variations in nitrogenase activity. A very few plants can grow and fix N2 under shade (e.g., Flemingia congesta under plantain canopy). In alley farming if hedgerows are not weeded, or if trees are planted with food crops like cassava, their nitrogen fixation and growth will be reduced due to shading. Early growth of legume trees is slow and they cannot compete successfully for light.
2. Extreme temperatures affect N2 fixation adversely. This is easy to understand because N2 fixation is an enzymatic process. However, there are differences between symbiotic systems in their ability to tolerate high (>35°C) and low (
There are many but, in my opinion, the most important factors that we should be aware of are 1-Drought(soil moisture) should be at least 20%.2- Ammonium(NH4+) content in soil(the higher the content is the lowest nodulation occurs).
Ther are many factors , like increased or decreased N or Fe microelmints in soil . These elmints are affecting in modulation formulas also the ph in soil and soil moisture and amminum contains in soil
Phosphorus is another important nutrient factor that affects nodule formation and BNF rstes, sice the high ATP requirement of this enzymatic biological process.