Anxiety is often a cause of headache and muscular tension in the upper back and shoulders. As already suggested I would look into your breathing and also into relaxation techniques. Pilates is great for both and teaches you to effectively strengthen these muscles and also how to not overuse them especially if your core muscles are weak. Hands on treatment is effective for reducing spasm and treating headaches.