This paper derives the optimal solution for a distributionally robust multi-product newsvendor problem, in which different products are produced under a capacity constraint, while only the mean and variance of the product demand are known. The problem aims to find a capacity allocation scheme to minimize the system cost of the worst-case among all possible demand distributions. When the total capacity is among certain ranges, the optimal solution has a closed-form. For other ranges, the optimal solution can be derived by solving one equation. The solution shows that there exist a number of threshold values for the capacity, below which some products are neglected (allocated with zero capacity). Besides, in the optimal solution, which products are prioritized for production is determined by the order of an index measured by the unit production cost, unit shortage cost, demand mean, and demand variance. For a special case where the cost structures for different products are identical, a closed-form solution is derived for any total capacity value. For this special case, the index order is simply determined by the coefficient of variation of each product demand. Sensitivity analysis shows that when the capacity is abundant, a larger demand variability of one product may cause a higher production quantity for this product; while if the capacity is tight, a larger demand variability cause a lower production quantity. For a set of test problems, the performance of the robust optimization solution is quite close to that of the stochastic optimization solution.