We demonstrate supramolecular polymerization and formation of 1D nanofiber of azobenzene based organogelator (AZO-4) in cyclic hydrocarbon solvents (toluene and methylcyclohexane). The AZO-4 exhibits J- and H-type aggregates in toluene: MCH (9 : 1) and MCH: toluene (9 : 1) respectively. The type of aggregate was governed by the geometry of the solvents used in the self-assembly process. The J-type aggregates with high thermal stability in toluene is due to the enhanced interaction of AZO-4 π- surface with the toluene π-surface, whereas H-aggregate with moderate thermal stability in MCH was due to the interruption of the cyclic hydrocarbon in van der Waals interactions of peripheral chains of AZO-4 molecule. The light induced reversible photoisomerization is observed for both J- and H-aggregates. The macroscopic property revealed spontaneous and strong gelation in toluene preferably due to the strong interactions of the AZO-4 nanofibers with the toluene solvent molecules compared to the MCH. The rheological measurements revealed thixotropic nature of the gels by step-strain experiments at room temperature. The thermodynamic parameter (ΔHm) of gel-to-sol transition was determined for all the gels to get more insight into the gelation property. Furthermore, the phase selective gelation property was extended to the oil spill recovery application using diesel/water and petrol/water mixture.