A topology optimization strategy with coupled fluid–solid interaction was proposed to maximize the cooling efficiency of a kind of structure applied for scramjets. The Galerkin finite element method (FEM) is used to solve the forced convective heat transfer, and the rational approximation of material properties (RAMP) method combined with the globally convergent method of moving asymptotes (GCMMA) method are used to solve the topological optimization models with different boundary conditions and objective functions. Examples are provided to demonstrate the validity and effectiveness of the optimization strategy. The optimal flow passages of scramjet structures are achieved successfully. Compared with a baseline structure with rectangular straight passages, the optimized flow passages significantly reduce the averaged bulk temperature and pressure loss, and the bulk temperature is more uniform to avoid the occurrence of concentrated high-temperature areas. With the Reynolds number changing from 1000 to 1750, the heat transfer performance of the three-dimensional topology-optimized structure increases by 16.79% to 20.82%.