(I know Rayleigh scattering isn't the only reason why the sky is blue but to simplify the question lets focus on that)
The commonly stated reason for why the sky is blue is that smaller wavelengths are scattered more easily off the molecules in the air. During the day, because the blue light is scattered more, the sky is illuminated more with that blue light and more reaches your eyes. However, during sunsets and sunrises, the light from the sun must travel a longer distance. The explanation I have found is that the blue light is scattered away and more of the longer wavelength reds and greens are available to reach your eyes to get those warmer colors, (red and green of course mixing to get yellows).
My question is that it seems like these explanations are conflicting. If the light at sunsets and sunrises travels more distance, why won't the blue light be scattered even more and thus illuminate the sky with blue light more than in the daylight? It confuses me that in one case the scattering of blue light causes the sky to be blue but then at sunset the scattering eliminates this color. Could I get some explanation on this?