Expressions for the particle and energy loss fluxes of a plasma in a realistic mirror configuration are obtained by using self-consistent analytic solutions of a bounce-averaged linearized Fokker-Planck equation for ions and electrons. The magnetic-field variation along the field lines is taken into account, and both interactions between ions and electrons and effects of the ambipolar potential are included in the analysis. An eigenfunction expansion is employed to obtain the solution for the ions. The value of τn ( is the volume-averaged particle density and τn the particle confinement time) is shown to decrease, because of effects of magnetic-field variation, by a factor of two as compared with the value for the magnetic square well, and the total energy confinement time is almost equal to the particle confinement time.