In present work an experiment has been designed to measure the Rayleigh ratio directly at 405 nm and 432 nm for linear alkylbenzene which is a common solvent used in liquid scintillator detectors of neutrino experiments. The perpendicularly polarized Rayleigh ratio is determined to be (4.52±0.28)×10−6 m−1⋅ sr−1 at 405 nm and (3.82±0.24)×10−6 m−1⋅ sr−1 at 432 nm, and the corresponding Rayleigh scattering length is LRay=22.9±0.3(stat.)±1.7(sys.) m at 405 nm and LRay=27.0±0.9(stat.)±1.8(sys.) m at 432 nm.