'Døden' må komme før 'nær'?
This is a fixed expression, but 'nær døden' could also work.
You could also say "Jeg var nær ved å dø"(I was close to dying).
Han var døden nær, og da hadde han en nær-døden-opplevelse.
Is this a surviving archaic construction, from the days of a more highly inflected Norse?