We derive a rigorous nuclear gradient for a molecule-cavity hybrid system using the Quantum Electrodynamics Hamiltonian. We treat the electronic-photonic DOFs as the quantum subsystem, and the nuclei as the classical subsystem. Using the adiabatic basis for the electronic DOF and the Fock basis for the photonic DOF, and requiring the total energy conservation of this mixed quantum-classical system, we derived the rigorous nuclear gradient for the molecule-cavity hybrid system, which is naturally connected to the approximate gradient under the Jaynes-Cummings approximation. The nuclear gradient expression can be readily used in any mixed quantum-classical simulations and will allow one to perform the non-adiabatic on-the-fly simulation of polariton quantum dynamics. The theoretical developments in this work could significantly benefit the polariton quantum dynamics community with a rigorous nuclear gradient of the molecule-cavity hybrid system and have a broad impact on the future non-adiabatic simulations of polariton quantum dynamics.