A soy oil-based polyol (HSBP) was synthesized from epoxidized soy oil through a ring-opening reaction with distilled water. A phosphorus-containing flame retardant (DOPO-HSBP) was synthesized through the reaction of 9,10-dihydro-9-oxa-10-phosphaphenanthrene-10-oxide (DOPO) and HSBP. A nitrogen-containing flame retardant (T-D) was prepared by the reaction of diethanolamine with glycol diglycidyl ether. The structures of HSBP, DOPO-HSBP, and T-D were characterized by Fourier transform infrared spectroscopy (FT-IR) and nuclear magnetic resonance (H-1 NMR). The flame-retardant rigid polyurethane foam (PPUFs and NPUFs) was prepared successfully by mixing HSBP, DOPO-HSBP, and T-D. The effects of DOPO-HSBP content on the mechanical, thermal, and flame-retardant properties of PPUFs and NPUFs were investigated by tensile tests, thermogravimetric analyses (TGA), limiting oxygen index (LOI), and UL-94 vertical burning level. The morphology of PPUFs and NPUFs was studied via scanning electron microscopy (SEM). With the increase in the percentage of DOPO-HSBP added, the flame retardant property of rigid polyurethane foam (RPUF) was greatly improved. When the phosphorus-containing flame retardant DOPO-HSBP was added to 50% of the RPUF with the nitrogen-containing flame retardant T-D, the LOI value of the foam increased from 18.3 to 25.5, and the UL-94 result was classified as "V-0" with almost no effect on the mechanical properties of the RPUF. The results showed that the phosphorus and nitrogen synergistic flame retardants of DOPO-HSBP and T-D can endow excellent flame retardant properties to RPUF without affecting its mechanical properties.