Nginx does not use the system resolver the way most programs do. It wants a resolvers directive, and NPM writes one for you.
If you want to switch that off, there is a variable:
environment:
DISABLE_RESOLVER: true
The docs say NPM then stops generating a resolvers directive, and DNS lookups go through /etc/hosts first and then /etc/resolv.conf. That fits a setup where hostnames only exist in /etc/hosts, or where you want the container to follow the DNS of the machine it runs on.
It is a niche setting. My advice: leave it alone until a proxy host to an internal name fails to resolve, and then try it. The caveat is that you now depend on those two files being right. A typo in /etc/hosts becomes a 502, and the generated resolver that used to hide a bad DNS server is gone. Test one host before you rely on it.
If you want to look at what changed, the generated config lives under /data/nginx in the folder you mount, so you can read it without entering the container.
Further reading: Nginx Proxy Manager: Advanced Configuration, On this site: pin the Nginx Proxy Manager image version, upgrade on purpose, On this site: Nginx Proxy Manager has a health check, you just have to switch it on, On this site: Guide: put Nextcloud behind Nginx Proxy Manager with HTTPS and the right headers
Going deeper: Guide: fix a 502 Bad Gateway in Nginx Proxy Manager, with a checklist that finds the cause