In this paper, we study a dynamic optimization problem for a general nonlinear mathematical model for therapy of a lethal form of cancer. The model describes how the populations of cancer and normal cells evolve under the influence of the concentrations of nutrients (oxygen, glucose, etc.) and the applied therapeutic agent (drug). Regulated intensity of the therapy is interpreted as a time-dependent control strategy. The therapy (control) goal is to maximize the viability time, i. e., the duration of staying in a so-called safety region (which specifies safe living conditions of a patient in terms of constraints on the amounts of cancer and normal cells), subject to limited resources of the therapeutic agent. In a specific benchmark case, a novel optimality principle for admissible therapy strategies is established. It states that the optimal trajectories should finally reach a certain corner of the safety region or at least the upper constraint on the quantity of cancer cells. The results of numerical simulations appear to be in good agreement with the proposed principle. Typical qualitative structures of optimal treatment strategies are also obtained. Furthermore, important characteristics of the model are the competition coefficient (describing the negative influence of cancer cells on normal cells), the upper bound in the drug integral constraint, and the ratio between the therapy and damage coefficients (i. e., the ratio between the positive primary and negative side effects of the therapy).