Bladder infection has no relation to headache.
Only passing urine with heavy difficulty may cause rise in pressure of head and cause headache.
is antiinflammatory drug given for inflammation.
If you are suspected for Urinary tract infection
you need to get a urine test done and get some antibiotics for it.
Since your only complain is headache which reduces when staying calm it may be a migraine
You need to take paracetamol
and other migraine medications like ergot alkaloids which can be prescribed by a physician, caffiene also helps in reducing migraine