We argue that hadron production in coherent diffraction of protons on a heavy nucleus provides a very sensitive probe of the low-x QCD dynamics. This process probes the BFKL dynamics in protons and the nonlinear gluon evolution in nuclei. We calculate the diffractive hadron production cross sections in the BNL Relativistic Heavy Ion Collider (RHIC) and CERN Large Hadron Collider (LHC) kinematic regions. To study the nuclear effects we introduce the diffractive nuclear modification factor. We show that, unlike the nuclear modification factor for inclusive hadron production that has very interesting dynamics at RHIC but is expected to be almost completely saturated at the LHC, the nuclear modification factor for diffractive production exhibits a nontrivial behavior at both RHIC and LHC.