I'm unsure of how you are sure your headaches are from your back. However, any head pain needs to be addressed with more than meds that don't work

Is it that your back pain is severe enough that your muscles are tensing and causing the tension headache? Are you stressed because of severe back pain?
Have you tried ice packs on the painful back area? (((hugs))