Wherever there is a P wave in a earthquake it is an underground explosion moving the soil up and down. And that explosion is nuclear. Wherever there is a tiny way for photons to get out it (for instance plaques moving, with some S waves) it causes this : earthquake lights. Blueish because of the very high temperatures as these explosions are usually extremely powerful, for some light to be able to get out. This does not happen frequently.
This image in Japan is a nice example.
(see my article for reference !)