Is glaucoma a disease related to optic nerve or aqueous humor?

Yes. If the aqueous humor flow is disturbed, usually by some degree of obstruction of the drains inside the eye. Then the pressure elevates. This can cause compromise to the nerves and blood vessels at the optic nerve, with loss of vision if not treated. So glaucoma is a disease of the aqueous flow which affects the vision through the optic nerve.
Both. In glaucoma there is either an over production of the aqueous humor or a problem with the drainage of this fluid from the inside of the eye. If the pressure in the eye is elevated, this can cause damage to the optic nerve and impair the vision.