Background mist with gradient

Not sure if it goes in this board but oh well
***So I set up a little scene im working on and im trying to let the background fade out with a mist. I also want to give it a more “atmospheric” feeling by giving the top of the mist a different color, if that makes any sense to you.
Tried doing it by giving a box a volumetric scatter and applying a gradient on that to simulate it but that lags my PC pretty hard and eventually crashes blender so thats not really an option
Heres the render with the nodes



And here is what im trying to get if you didnt get my awful explenation


Well kind off. Quickly did this in photoshop. So yeah, help.

Hi KawaiiNacho,


Actually what you want is (taking the example of your second picture) the mist at the bottom and the sky at the top with the color of your choice.
I recently made for myself a custom node setup for the World. When mixed with the mist, I get what you want.
I’ll make a picture and post it later.

Edit:
This is the result with my setup. Note that there is no ‘sun flare’ as the one in the default Blender sky, I use EasyFX for that.



Custom Sky with mist.blend (375 KB)

I mixed Dito’s solution with my current node and I got the result I wanted, thanks. Altrough Akikun’s solutions seems allot more simpler but allah. Got it right and im happy with it.



Thanks allot!