Can someone explain this eye problem?

When I look far to either side or up and down, the back of my eyes hurt. It feels there's like a serious strain on them. I know looking at a computer/phone screen for a long period of time can cause this, however I have actually decreased my time on my phone and computer before this problem came up, and it still began hurting. I do have chronic migraines, but this problem has never came up before. Has anyone experienced this too? What do you suggest I do about it?