Tunability and selectivity of synchrotron radiation have been used to study the excitation and ionization of 2-nitroimidazole at the C, N, and O K-edges. The combination of a set of different measurements (X-ray photoelectron spectroscopy, near-edge photoabsorption spectroscopy, Resonant Auger electron spectroscopy, and mass spectrometry) and computational modeling have successfully disclosed local effects due to the chemical environment on both excitation/ionization and fragmentation of the molecule.