Looks like there's already some blocking on the inside that could be used to attach screws or nails. If the cabinet sides are plywood or MDF, which looks to be the case, I'd apply wood glue liberally then pull everything back into alignment with clamps. I'd pre-drill holes for some screws, and run them into the existing blocks. I've seen too many nails let loose, so I tend to use screws for anything I care about. Counter-sink the screws so they're level with, or slightly below, the cabinet surface.
Looks like the side and back are a bit messed up. You might want to clean those spots up with a chisel before you glue everything back together. Once the glue has set, you could use Bondo to fill in the divots, then sand everything smooth. Or just paint it to match the cabinet; the damage is in the back so it's unlikely anyone will look at it closely.