Interfaces in MgO/FeCoB/MgO trilayer have been studied with grazing incident nuclear resonance scattering using the x-ray standing wave technique. High depth selectivity of the present method allows one to measure magnetism and structure at the two interfaces of FeCoB, namely, FeCoB on MgO and MgO on FeCoB, independently, yielding an intriguing result that both interfaces are not symmetric. A high-density layer with an increased magnetic hyperfine field at the FeCoB-on-MgO interface suggests different growth mechanisms at the two interfaces. The azimuthal angle-dependent magneto-optic Kerr effect measurements reveal the presence of unusual uniaxial magnetic anisotropy (UMA) in the trilayer. An in situ temperature-dependent study discovered that this UMA systematically reduces with temperature. After annealing at 250 • C, the trilayer starts following the standard Stoner-Wohlfarth model for in-plane UMA. The trilayer becomes isotropic at 450 • C with an order-of-magnitude increase in coercivity. The asymmetry at the interfaces is in turn explained by boron diffusion from the FeCoB interface layer into the nearby MgO layer. Stress-induced UMA is observed in the boron-deficient FeCoB layer, superimposed with the bulk FeCoB layer, and found to be responsible for unusual UMA. The temperature-dependent variation in the UMA and coercivity can be understood in terms of variations in the internal stresses and coupling between FeCoB bulk and the interface layer.