We consider a class of solutions in multidimensional gravity which generalize Melvin’s well-known cylindrically symmetric solution, originally describing the gravitational field of a magnetic flux tube. The solutions considered contain the metric, two Abelian 2-forms and two scalar fields, and are governed by two moduli functions H1(z) and H2(z) (z = ρ2, ρ is a radial coordinate) which have a polynomial structure and obey two differential (Toda-like) master equations with certain boundary conditions. These equations are governed by a certain matrix A which is a Cartan matrix for some Lie algebra. The models for rank-2 Lie algebras A2, C2 and G2 are considered. We study a number of physical and geometric properties of these models. In particular, duality identities are proved, which reveal a certain behavior of the solutions under the transformation ρ → 1/ρ; asymptotic relations for the solutions at large distances are obtained; 2-form flux integrals over 2-dimensional regions and the corresponding Wilson loop factors are calculated, and their convergence is demonstrated. These properties make the solutions potentially applicable in the context of some dual holographic models. The duality identities can also be understood in terms of the Z2 symmetry on vertices of the Dynkin diagram for the corresponding Lie algebra. © 2017, Pleiades Publishing, Ltd.