Nginx Error: a duplicate default server for 0.0.0.0:80

Two enabled virtual hosts both declare `listen 80 default_server;`.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Nginx Error Platform: Nginx
Common Root Causes:
  • Two enabled virtual hosts both declare `listen 80 default_server;`.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Keep `default_server` on only one catch-all vhost per IP:port pair.
Safe Diagnostic Command:
nginx -t && grep -rn default_server /etc/nginx/sites-enabled/
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Two enabled virtual hosts both declare `listen 80 default_server;`. Recommended diagnostic: `nginx -t && grep -rn default_server /etc/nginx/sites-enabled/`. Remediation: Keep `default_server` on only one catch-all vhost per IP:port pair.

Worked Examples

  • Run `nginx -t && grep -rn default_server /etc/nginx/sites-enabled/` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-nginx-duplicate-default-server · Independently verified: 2026-11-25

Related Resources