We have designed, built, and tested a new instrument for soft x-ray scattering experiments. The reflectometer works under ultrahigh vacuum and permits in situ preparation and characterization of the samples. In particular, deposition and sputtering operations can be performed while measuring x-ray scattering. We report the results of test measurements performed using synchrotron radiation. The precision of the combined positioning of sample and detector angles is better than 0.01°. Separately, sample and detector rotations have a repeatability that is better than 0.005°. Applications will be in the field of surface physics, with emphasis on magnetic properties of surfaces, thin films, and multilayered structures.