also hang-nail, "sore strip of partially detached flesh at the side of a nail of the finger or toe," probably a 17c. or earlier folk etymology and sense alteration (as if from hang (v.) + (finger) nail) of Middle English agnail, angnail "a corn on the foot," from Old English agnail, angnail. The literal sense probably is "painful spike" (in the flesh). The first element would be Proto-Germanic *ang- "compressed, hard, painful" (from PIE root *angh- "tight, painfully constricted, painful"). The second element is Old English nægl "spike" (see nail (n.)).
Compare Old English angnes "anxiety, trouble, pain, fear;" angset "eruption, pustule." OED also compares Latin clavus, which "was both a nail (of iron, etc.) and a corn on the foot." Similar compounding in Old High German ungnagel, Frisian ongneil.