This paper introduces a novel generalized self-tuning regulator based on online support vector regression (OSVR) for nonlinear systems. The main idea is to approximate the parameters of an adaptive controller by optimizing the regression margin between reference input and system output. For this purpose, "closed-loop margin'' which depends on tracking error is defined, and the parameters of the adaptive controller are optimized so as to minimize the tracking error which leads simultaneously to the optimization of the closed-loop margin. The overall architecture consists of an online SVR which computes a forward model of the system, an adaptive controller with tunable parameters and an adaptation mechanism realized by separate online SVRs to estimate each tunable controller parameter. The proposed architecture is implemented with adaptive proportional-integral-derivative (PID) and adaptive fuzzy PID in the controller block. The performance of the generalized self-tuning regulator mechanism has been examined via simulations performed on a bioreactor benchmark system, and the results show that the generalized adaptive controller and OSVR model attain good control and modeling performances.