The pipe conveying fluid is widely utilized in ocean, nuclear power, aerospace and other significant engineering applications. Due to the coupling effect between the pipe and fluid, buckling and flutter behaviors may occur when the pipe is subjected to internal fluid flows. In general, the boundary condition has an important effect on dynamic behaviors of the pipe, especially when the support condition is at different locations. Most of previous studies focus on dynamics of straight or regular curved pipes (e.g. arc, semicircular and sin shapes), few researches concern on pipes with complex configurations like L, S and U shapes, which are indeed commonly applied in engineering fields. A general theoretical model is established by virtue of absolute node coordinate formulation (ANCF) in this paper, which can be used to solve dynamic problems of the fluid-conveying pipe with arbitrary configurations and boundary conditions. Considering three typical configurations, namely, L, S and U shapes of the pipe conveying fluid. Firstly, the uniform convergence analysis is carried out for the established theoretical model, to find applicable number of computational elements. Subsequently, the results of CFD simulation method is used to compare with and validate the theoretical model. The results show that compared to the finite element method, the theoretical model based on the absolute node coordinate formulation has higher computational efficiency when predicting the nonlinear deformations of pipe conveying fluid with complex configurations. Based on the theoretical model, the effects of support position on natural frequency, buckling displacement and strain of the three considered pipes are investigated. The results also show that there is an optimal position of the support where the fundamental frequency reach the maximum, while buckling displacement and strain of the pipe reach the minimum. This study can provide theoretical basis and design guidance for improving the stability and lifetime of pipes in engineering.