A hot bath or shower, or heat applied in other ways, often works for me.
However if I had a headache that lasted days I would be going to the doctor.
Edited to add from here
Take a hot bath. Most people probably don't know about this one, but it's a technique that can give you almost immediate relief. There are three reasons for this. The first is that laying in hot water thins your blood, which is what aspirin does. The second is because laying with your head on the back of the tub realigns the pressure points on your neck and shoulders. The third is that hot water lets off steam, even if you can't see it, which helps to loosen up sinus congestion. To work, the bath needs to be as hot as you can stand. Generally the best way to get the water really hot, is turn the tap on warm, get in, then turn up the heat as you go. This way your body will grow accustomed to the heat as you lay there.