The accurate description of solvent effects on X-ray absorption spectra (XAS) is fundamental for comparing simulated spectra with experiments in solution. Currently, few protocols exist that can efficiently reproduce the effects of the solute/solvent interactions on XAS. Here, we develop an efficient and accurate theoretical protocol for simulating the solvent effects on XAS. The protocol combines electrostatic embedding QM/MM based on electrostatic potential fitted (ESPF) operators for describing the solute/solvent interactions and mixed-reference spin-flip time-dependent density functional theory (MRSF-TDDFT) for simulating accurate XAS spectra. To demonstrate the capabilities of our protocol, we compute the X-ray absorption of neutral proline in the gas phase and ionic proline in water in all relevant K-edges, showing an excellent agreement with experiments. We show that states represented by core to π * transitions are almost unaffected by the interaction with water, whereas the core to σ * transitions are more impacted by the fluctuation of proline structure and the electrostatic interaction with the solvent. Finally, we reconstruct the pH-dependent X-ray absorption spectra of proline in solution, determining that the N K-edge can be used to distinguish its three protonation states.