For solving the eikonal equation in the regions near the curved earth's surface and the curved interface, we find a second order upwind finite difference scheme that uses nonuniform grid spacing in the regions near the earth's surface and the interface, respectively. Specifically, in the direct neighborhood of the earth's surface and of the considered interface, we replace the regular grid spacing in the vertical direction by the vertical distance between the surface (interface) point and the grid point under consideration. For the horizontal direction, however, only the regular grid points are used. As a result, the conventional upwind finite difference formulas are changed into the ones with nonuniform grid spacing. Furthermore, for capturing and propagating the local wavefront near the curved earth's surface (interface), we adapt the fast marching method by introducing new point types, namely the surface point, the point above the surface, the interface point, and the point under the interface. If we use the scheme in a multistage fashion, we can compute not only the traveltimes of the first arrivals but also the traveltimes of the reflected and transmitted events. In comparison to the published schemes, our scheme has the following two advantages: (1) there is no need to construct a local unstructured grid for suturing the surface or the interface points to the neighboring regular grid points; (2) there is no need to make a local coordinate transform for capturing the local wavefront. Numerical results show that our scheme can treat the irregular region problem caused by the curved earth's surface and by the curved interface with satisfactory effectiveness and flexibility.