Muscle pain due to prolonged stress?

I was diagnosed with gastritis five months ago. Since then, I’ve been really stressed and anxious. It gets better somedays but other days can be hard.
I started having headaches and ear pressure/pain last month. Along with that, I started having random muscle pains in my face, arms, pelvis and legs.
These last a few seconds and I get these a few times a day. These don’t hurt too much (since they last a few seconds each and not bad enough to take medications) but can be very annoying and only stress me out more. I’ve had a bit of a hard time with health anxiety. That’s when this started.
Some symptoms get better while some persist.
Could these be related to stress/anxiety?
Can stress cause chronic or long term pain?