At death’s door
The notion of death as a portal to another place is very ancient although this particular expression of it dates from the 1500s. The phrase is frequently used in an exaggerated sense when someone is feeling ill.