sudo nginx -T | grep -E 'server_name|listen'

Category: VPS Management

sudo nginx -T | grep -E 'server_name|listen'

Audit all virtual hosts in one pass

nginx -T dumps every loaded config file as one merged document, and the grep pulls out the server_name (hostname) and listen (port) lines — a full map of what the server answers for. It reveals overlapping server blocks that can cause traffic to hit the wrong site. This is the config-level site inventory.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.