Catalyzes the dephosphorylation of an unusually broad range of substrate including deoxyribo- and ribonucleoside tri-, di-, and monophosphates, as well as polyphosphate and glucose-1-P (Glu1P). a ribonucleoside 5'-phosphate + H2O = a ribonucleoside + phosphate Magnesium. Can also use other divalent metal cations as manganese, cobalt or zinc. Monomer. By N-acetylglucosamine. Belongs to the HAD-like hydrolase superfamily. NagD family.