He almost did die. Even pulling out of the trench at full speed immediately after making the shot (not waiting to see if it went in) and burning directly away from the station at full speed, his X-wing was stil rocked back and forth with the energy of the explosion. Eventually he and the other ships managed to outrun the blast wave.
Luke knew that the moment would be imprinted on his memory forever.
The way the ring of pure energy and fire blew out from the center of
the battle station, ripping it apart into nothing more than shreds of
metal and dust. The pressure of the detonation rocked the X-wing,
sending it bobbing. Just as quickly, his flight smoothed out again and
calm returned to the galaxy. The terrifying giant was gone, and with
it the weight of fear that had been pressing down on Luke.
A New Hope: The Princess, the Scoundrel, and the Farm Boy
And then there was an explosion.
Luke got away just in time. He looked back over his shoulder. In a
blinding flash of light, the Death Star burst into a billion pieces.
Classic Star Wars: A New Hope
The three Rebel starfighters and the Falcon were barely out of the
danger zone when the Death Star exploded in an immense, blinding
flash. From a distance, the blast resembled a small supernova.
Star Wars Episode IV: A New Hope - Junior novelisation