The article proposes a nonlinear optimal control method for treating the control and stabilization problem of supply chain networks and inventories under time-delays. The state-space model of the supply chain network is considered to have as state variables the customer's demand and the inventories of the manufacturer, of the retailers and of the distributors. The control inputs of the model are the manufacturer's production and the retailer's ordering quantities. The model is subject to time-delays. It is proven that the dynamic model of the supply chain is differentially flat. This model undergoes approximate linearization around a temporary operating point that is recomputed at each time-step of the control method. The linearization relies on Taylor series expansion and on the associated Jacobian matrices. For the linearized state-space model of the supply chain a stabilizing optimal (H-infinity) feedback controller is designed. This controller stands for the solution to the nonlinear optimal control problem under model uncertainty and external perturbations. To compute the controller's feedback gains an algebraic Riccati equation is repetitively solved at each iteration of the control algorithm. The stability properties of the control method are proven through Lyapunov analysis. The method achieves fast and accurate tracking of the targeted setpoints by the state variables of the supply chain system under moderate variations of the control inputs.