Why is the volumetric fog not displayed correctly in the final render?

When I render my scene, the volumetric fog does not look like it does in the viewport. What could be the reason for this?

Viewport:

Final Render: