I had that on and off for years, made worse by poor sitting posture and made lots worse by bike riding. I went to a chiropractor, which helped, but what helped the most was a regular stretching routine to become more flexible. Especially my hamstrings. I rarely have any pain now. If I stand for long periods of time I have to make sure I don't lock my knees (I think it was Knot who gave that advice.)