Understanding the domain wall (DW) dynamics in magnetic nanowires (NW) is crucial for spintronic-based applications demanding the use of DWs as information carriers. This work focuses on the dynamics of a DW displacing along a bent NW with an elliptical shape under the action of spin-polarized electric currents and external magnetic fields. Our results evidence that a curvature gradient induces an exchange-driven effective tangential field responsible for pinning a DW near the maximum curvature point in a NW. The DW equilibrium position depends on the competition between the torques produced by the external stimuli and the curvature-induced effective fields. When the external stimuli are below a certain threshold, the DW follows a damped harmonic oscillation around the equilibrium position. Above this threshold, DW displaces along the NW under an oscillatory translational motion.