Several Gram-negative bacteria cause urinary infections, for example E. coli and Klebsiella. They produce an enzyme called nitrate reductase and can convert the nitrates in urine to nitrites. You do not need to know the details of this reaction, just that these nitrites can be detected using the Greiss reaction in which nitrites react to produce a pink dye. The presence of pink on the dipstick test can therefore indicate a bacterial urinary infection, although this test is not completely reliable.
OpenLearn - Understanding antibiotic resistance
Except for third party materials and otherwise, this content is made available under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Licence, full copyright detail can be found in the acknowledgements section. Please see full copyright statement for details.