This paper investigates the problem of fault detection (FD) for a class of discrete-time nonlinear systems by using Hi/H∞ optimization. A finite horizon index Hi and H∞ norm are introduced to represent the sensitivity of residual to fault and robustness of residual against unknown input, respectively. Then the problem of residual evaluation is formulated as to a nonlinear Hi/H∞ optimization. It is shown that a local optimal Hi/H∞ FDF can be obtained by recursively computing of extended Kalman filter and a post-filter. Moreover, the local optimal solution is not unique and, for an arbitrary feasible filter gain matrix, a dynamic post-filter is also presented. A numerical example is given to demonstrate the effectiveness of the proposed method.