When you say exercise, are you referring to resistance training? If so, you shouldn't be training before bed because that would mean you are not following correct post-workout protocol. After you train you should be having a shake with water, dextrose, maltodextrin and sodium. It should take you 1 hr to drink this. An hour after FINISHING your shake, you should then be having a balanced meal. Thus, if you are referring to weight training, you shouldnt be able to train just before bed for these reasons.
However, if you are referring to cardio or other training, I wouldn't recommend training right before bed as you may find it difficult to sleep, and thus your rest and consequently ability to recover is negatively affected.
Also, why are you going to bed at 1am? Unless you dont have to wake until 9 - 10am then you should definitely be getting to bed earlier!!
Not being able to eat before bed is a myth. I strongly recommend that you eat before bed. And as I am pretty sure, you are weight training, and aiming to increase lean body mass, you dont want you body to be neglected of nutrient throughout the night. Therefore, before bed I recommend you consume:
1. A slow-digesting protein source. Although whey might be easier, you should really cut out the protein shake here. It is a fast digesting protein and will do little to supply sustained amino acids to your body. It is in the morning that you should have this, because its fast digesting characteristic ensure it assists in quickly taking from a catabolic to an anobolic state. I do however, recommend you have cottage cheese. It consists of a casein protein which is slow digesting.
2. A carb source. You dont need a lot of carbs before bed, as you wont be buring many calories while sleeping. However consuming carbs will assist in the proper digestion and absorbtion of your amino acids. Once again, its should be slow digesting, i.e. low glycemic. Porridge and/or green leafy vegies could be consumed.
3. Essential Fatty Acids (EFAs). EFAs slow the digestion process, as fats are digested much more slowly than protein or carbs. The best way to achieve a good amount of EFAs here would be with a tablespoon of flaxseed oil