Correct. The force depends on the amount by which the spring is stretched. So it depends on where the body is located, relative to whatever is holding the other end of the spring.