Uncertainty quantification requires efficient summarization of high- or even infinite-dimensional (i.e., nonparametric) distributions based on, e.g., suitable point estimates (modes) for posterior distributions arising from model-specific prior distributions. In this work, we consider nonparametric modes and maximum a posteriori (MAP) estimates for priors that do not admit continuous densities, for which previous approaches based on small ball probabilities fail. We propose a novel definition of generalized modes based on the concept of approximating sequences, which reduce to the classical mode in certain situations that include Gaussian priors but also exist for a more general class of priors. The latter includes the case of priors that impose strict bounds on the admissible parameters and in particular of uniform priors. For uniform priors defined by random series with uniformly distributed coefficients, we show that generalized MAP estimates---but not classical MAP estimates---can be characterized as minimizers of a suitable functional that plays the role of a generalized Onsager--Machlup functional. This is then used to show consistency of nonlinear Bayesian inverse problems with uniform priors and Gaussian noise.