Many real networks feature the property of nestedness, i.e. the neighbours of nodes with a few connections are hierarchically nested within the neighbours of nodes with more connections. Despite the abstract simplicity of this notion, various mathematical definitions of nestedness have been proposed, sometimes giving contrasting results. Moreover, there is an ongoing debate on the statistical significance of nestedness, since random networks where the number of connections (degree) of each node is fixed to its empirical value are typically as nested as real ones. By using only ergodic and unbiased null models, we propose a clarification that exploits the recent finding that random networks where the degrees are enforced as hard constraints (microcanonical ensembles) are thermodynamically different from random networks where the degrees are enforced as soft constraints (canonical ensembles). Indeed, alternative definitions of nestedness can be negatively correlated in the microcanonical one, while being positively correlated in the canonical one. This result disentangles distinct notions of nestedness captured by different metrics and highlights the importance of making a principled choice between hard and soft constraints in null models of ecological networks.