grep -r walks a whole folder tree, which is great until it also walks .git, node_modules and a few gigabytes of logs. Then you get a screen full of hits from files you never meant to search.
Two options fix that. --include=GLOB only searches files whose name matches the glob, and --exclude-dir=GLOB skips directories with a matching name:
grep -rn --include='*.conf' --exclude-dir=.git 'listen' /etc/nginx
That searches only the .conf files and skips any .git folder on the way. You can repeat both options, so --include='*.yml' --include='*.yaml' catches both spellings of a compose file. On an Unraid box I’d point this at /mnt/user/appdata to find which container config mentions a certain port.
The caveat is the quotes. Without them your shell may expand *.conf into the names of files in the current folder before grep ever sees it, and then the filter is suddenly something else. Also note that --include looks at the base name of a file, not at its path, so --include='nginx/*.conf' won’t do what you hope. For that kind of path filtering, find is the better tool.
Further reading: grep(1) manual page
Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get